Skip to content

Conversation

@adrian-bobev
Copy link
Contributor

Summary

When typing text that doesn't trigger typeahead autocomplete (e.g., "k" or "and"), the filter incorrectly used a stale valueBeforeAutoComplete instead of the actual typed value, causing wrong suggestions to appear.

Symptoms:

  • Typing "k" showed all items instead of only "The United Kingdom..." (matching "Kingdom")
  • Typing "and" showed items matching "a" (Albania, Argentina) instead of items with word "and"

Root Cause:
The condition this._shouldAutocomplete || !!autoCompletedChars caused filtering to use valueBeforeAutoComplete even when there was no actual autocomplete. The _shouldAutocomplete flag is true during normal typing, but valueBeforeAutoComplete only updates when typeahead finds a match.

Fix:
Only use valueBeforeAutoComplete when there are actually autocompleted characters selected (autoCompletedChars > 0).

Test Plan

  • Added Cypress test for "k" scenario (no typeahead match, but filter match)
  • Added Cypress test for "and" scenario (typeahead match on first char, then no match)
  • All existing MultiComboBox tests pass

…ypeahead

When typing text that doesn't trigger typeahead (e.g. "k" or "and"),
the filter incorrectly used stale valueBeforeAutoComplete instead of
the actual typed value, causing wrong suggestions to appear.

Fixes:
- Typing "k" showed all items instead of only matching "Kingdom"
- Typing "and" showed items matching "a" instead of matching "and"
@cla-assistant
Copy link

cla-assistant bot commented Jan 28, 2026

CLA assistant check
All committers have signed the CLA.

@ui5-webcomponents-bot
Copy link
Collaborator

ui5-webcomponents-bot commented Jan 28, 2026

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

@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview January 28, 2026 22:04 Inactive
@adrian-bobev adrian-bobev requested a review from niyap January 28, 2026 22:07
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview January 29, 2026 21:30 Inactive
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview February 2, 2026 08:19 Inactive
@adrian-bobev adrian-bobev merged commit 212a3d1 into main Feb 2, 2026
21 of 22 checks passed
@adrian-bobev adrian-bobev deleted the fix/multicombobox-filtering-stale-value branch February 2, 2026 09:49
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview February 2, 2026 09:49 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.

4 participants