Skip to content

Conversation

ndeshev
Copy link
Contributor

@ndeshev ndeshev commented Oct 21, 2025

fixes: #12423

@ui5-webcomponents-bot
Copy link
Collaborator

ui5-webcomponents-bot commented Oct 21, 2025

🧹 Preview deployment cleaned up: https://pr-12514--ui5-webcomponents.netlify.app

@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview October 21, 2025 09:16 Inactive
@ndeshev ndeshev changed the title fix(ui5-multi-combobox): fix long token deletion issue fix(ui5-multi-combobox): fix long token deletion Oct 21, 2025
@ndeshev ndeshev marked this pull request as ready for review October 21, 2025 14:30
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview October 21, 2025 14:36 Inactive
@ndeshev ndeshev requested a review from nikoletavnv October 21, 2025 14:46
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview October 21, 2025 18:46 Inactive
@nikoletavnv
Copy link
Contributor

The fix works, but there is a different focus behavior depending on the order of the short and long token. You can try with the following code and observe that after deleting the "short" token, the focus goes to:

  • the long token in sample 1
  • goes out of the input in sample 2
// sample 1: 
<ui5-multi-input id="multi-input" style="width:210px">
  <ui5-token slot="tokens" text="Something very long here"></ui5-token>
  <ui5-token slot="tokens" text="Short"></ui5-token>
</ui5-multi-input>

// sample 2: 
<ui5-multi-input id="multi-input2" style="width:210px">
  <ui5-token slot="tokens" text="Short"></ui5-token>
  <ui5-token slot="tokens" text="Something very long here"></ui5-token>
</ui5-multi-input>

<script>
	const deleteToken = function (event) {
  const tokens = event.detail?.tokens;

  if (tokens) {
    tokens.forEach((token) => token.remove());
  }
};

document
  .getElementById('multi-input')
  .addEventListener('token-delete', deleteToken);

document
  .getElementById('multi-input2')
  .addEventListener('token-delete', deleteToken);
</script>

@ndeshev
Copy link
Contributor Author

ndeshev commented Oct 23, 2025

The strange focus management implementation of the ui5-multi-input where the app is handling the token deletion is out of the scope of the issue.

@ndeshev ndeshev merged commit 38a5049 into main Oct 23, 2025
20 of 22 checks passed
@ndeshev ndeshev deleted the token-delete-x branch October 23, 2025 07:06
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview October 23, 2025 07:06 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MultiInput, MultiComboBox]: Clicking "x" on token does not remove it if it's not the first in order

3 participants