Skip to content

feat(ui5-combobox): add trigger flag to selection-change event#13567

Open
ndeshev wants to merge 5 commits into
mainfrom
poc/combobox-selection-trigger-flag
Open

feat(ui5-combobox): add trigger flag to selection-change event#13567
ndeshev wants to merge 5 commits into
mainfrom
poc/combobox-selection-trigger-flag

Conversation

@ndeshev

@ndeshev ndeshev commented May 20, 2026

Copy link
Copy Markdown
Contributor

The selection-change event now includes a trigger property in its detail, allowing apps to distinguish between selection sources:

  • "typeahead" - auto-selection from typing
  • "click" - user clicked an item
  • "keyboard" - keyboard navigation (arrow keys, home, end, page up/down)

When enabled, typing does not auto-select matching items. Selection only occurs on explicit user action (Enter key, click, or keyboard navigation). This gives apps full control over when selection is applied.

noAutoSelection behavior:

Typing: no selection-change (typeahead doesn't select)
Arrow keys: selection-change fires (navigating selects items)
Enter: change event fires (confirms the selection)
Click: selection-change fires

JIRA: BGSOFUIRILA-4446

Related to #12727

The selection-change event now includes a `trigger` property in its detail,
allowing apps to distinguish between selection sources:
- "typeahead" - auto-selection from typing
- "click" - user clicked an item
- "keyboard" - keyboard navigation (arrow keys, home, end, page up/down)
@ui5-webcomponents-bot

ui5-webcomponents-bot commented May 20, 2026

Copy link
Copy Markdown
Collaborator

@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview May 20, 2026 14:55 Inactive
Replace the inline string union for the `trigger` property of the
selection-change event with a proper public enum
`ComboBoxSelectionChangeTrigger` (Typeahead | Click | Keyboard),
matching the convention used by other UI5 enums. Add Cypress tests
covering each trigger source.
@ivoplashkov ivoplashkov marked this pull request as ready for review June 11, 2026 06:53
@ivoplashkov ivoplashkov changed the title poc(ui5-combobox): add trigger flag to selection-change event feat(ui5-combobox): add trigger flag to selection-change event Jun 11, 2026
Comment thread packages/main/test/pages/ComboBox.html
Comment thread packages/main/test/pages/ComboBox.html Outdated
Comment thread packages/main/src/types/ComboBoxSelectionChangeTrigger.ts Outdated
- Update test page triggerColors keys and labels to PascalCase
  ("Typeahead" / "Keyboard" / "Click") to match the public enum.
- Remove leftover "enter" reference from the test page; Enter does
  not fire selection-change.
- Clarify in JSDoc that Enter does not fire selection-change but
  the change event instead.
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.

3 participants