Skip to content

fix(ui5-tokenizer, ui5-multi-input,ui5-multi-combobox): Improve stylisation#13314

Open
niyap wants to merge 1 commit intomainfrom
tokenizerstylingissues
Open

fix(ui5-tokenizer, ui5-multi-input,ui5-multi-combobox): Improve stylisation#13314
niyap wants to merge 1 commit intomainfrom
tokenizerstylingissues

Conversation

@niyap
Copy link
Contributor

@niyap niyap commented Mar 22, 2026

  • Tokenizer max-width calculation is adjusted: the inner-input width is correct now, as well as the --_ui5-input-icons-count is set to the tokenizer element itself in addition to the host element. This ensures the variable is available in the tokenizer's shadow DOM context where the max-width calculation is performed. Previously, the variable was only set on the MultiInput host, but the tokenizer's max-width calculation could not access it, resulting in the icon count being 0 instead of the correct value.
  • inner-input-with-icon attribute is always set when an icon is presented, no matter of its kind.
  • last-visible-token attribute added in order to mark the last visible that does not overflow when N-more indicator is present
  • inner-input width and paddings are adjusted according to the specification covering all the use cases (icon presented, tokenizer available or just an input field)

JIRA: BGSOFUIRILA-3333
FIXES: #5096
FIXES: #13184

@niyap niyap requested review from Vonahz and ivoplashkov March 22, 2026 22:27
@ui5-webcomponents-bot
Copy link
Collaborator

@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview March 22, 2026 22:34 Inactive
this.tokenizer.readonly = this.readonly;

// Set the CSS variable on the tokenizer element so it's available in the shadow DOM
this.tokenizer.style.setProperty("--_ui5-input-icons-count", `${this.iconsCount}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is not used as only tokens are rendered.

}

if (newMarkedToken) {
newMarkedToken.setAttribute("last-visible-token", "");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we not just make private property in the token as "lastVisibleToken" and then manipulate it here, this is how the framework will attach itself last-visible-token as attribute in its natural reactive way in the template. Something like:

    const tokensArray = this._tokens;
    const hasOverflow = this._nMoreCount > 0;
    const shouldMark = !this.expanded && hasOverflow;

    tokensArray.forEach((token, index) => {
        const isVisible = !token.overflows;
        const visibleTokens = tokensArray.filter(t => !t.overflows);
        const isLastVisible = isVisible && token === visibleTokens[visibleTokens.length - 1];
        
        token.lastVisibleToken = shouldMark && isLastVisible;
    });

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]: Incorrect Spacing between Tokenizer and Input Value ui5-tokenizer: Necessary improvements for proper stylisation

3 participants