Skip to content

[ui5-tokenizer]: n-more rendering loop in some localizations #14130

Description

@Vonahz

Bug Description

There are some cases that hitting specific width of n-more and tokenizer causes loop that makes the page unresponsive. In MultiCombobx.html test pages this is happening with the following example:

` MultiComboBox n more

	<ui5-multi-combobox class="multicombobox3auto" placeholder="Some initial text" id="more-mcb">
		<ui5-mcb-item text="Cosy" selected></ui5-mcb-item>
		<ui5-mcb-item text="Compact" selected></ui5-mcb-item>
		<ui5-mcb-item text="Condensed"></ui5-mcb-item>
		<ui5-mcb-item text="Longest word in the world" selected></ui5-mcb-item>
	</ui5-multi-combobox>`

Example in KO:

Step 1 — all 3 hidden, showing "3개 항목" (narrow, just "3 items")
Narrow indicator → more room → token[0] just fits → only 2 tokens overflow → _nMoreCount = 2

Step 2 — 1 token visible, showing "2개 항목 더 보기" (wide, "2 more items")
Wide indicator → less room → token[0] no longer fits → all 3 tokens overflow → _nMoreCount = 3

Step 3 — back to "3개 항목" → go to step 1

So "N items" (TOKENIZER_SHOW_ALL_ITEMS) is the narrower one, and "N more items" (MULTIINPUT_SHOW_MORE_TOKENS) is the wider one — the added 더 보기 ("more") suffix is what makes it significantly wider and causes the boundary flip

Affected Component

ui5-tokenizer, ui5-multiinput, ui5-multicombobox

Expected Behaviour

Not have loop error.

Isolated Example

https://ui5.github.io/webcomponents/nightly/packages/main/test/pages/MultiComboBox.html?sap-ui-language=ko

Steps to Reproduce

  1. Open the given link
  2. See the console error
  3. Page is unresponsive
    ...

Log Output, Stack Trace or Screenshots

No response

Priority

High

UI5 Web Components Version

2.27.2

Browser

Chrome

Operating System

MacOS

Additional Context

No response

Organization

No response

Declaration

  • I’m not disclosing any internal or sensitive information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions