You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When typing into a ui5-combobox, opening the suggestions popover triggers a programmatic refocus of the inner input, which runs the "select entire value" logic intended for a fresh user focus. If a keystroke arrives during the asynchronous popover-open window, it lands on a fully-selected input and overwrites the value typed so far.
Concretely, typing default character-by-character can end up as fault: after de, type-ahead correctly completes to default and selects only the suffix fault; then the popover finishes opening, focus is handed back to the input, the selection expands to the wholedefault, and the next keystroke replaces everything.
This is a timing/edge race — it predominantly affects fast or programmatic typing (e2e tools such as Cypress, possibly IME/paste sequences). A human typing at normal speed rarely hits the window, so it surfaces as a rare, hard-to-reproduce flake.
Affected Component
ComboBox
Expected Behaviour
Selecting-all on focus is correct for a genuine user focus. But when the popover-open sequence programmatically returns focus to the input during active typing, the in-progress value should be preserved — the remaining keystrokes should advance/append, not overwrite a newly select-all'd value.
Isolated Example
No response
Steps to Reproduce
Render a ui5-combobox with several items, one of them default.
Focus the input and type default character-by-character at a fast cadence (~10ms/char, as e2e tooling does), so a matching character opens the suggestions popover.
Intermittently: once the popover finishes opening, the input's selection expands from the type-ahead suffix to the entire value, and the still-queued characters overwrite it — the final value ends up truncated/garbled (e.g. fault), and the popover filters to nothing.
Log Output, Stack Trace or Screenshots
combobox-focus-bug.mp4
Priority
Medium
UI5 Web Components Version
Observed on 2.24.0. Verified still present on the current latest 2.27.2 (ComboBox.js: _focusin line 341, _afterOpenPopover lines 366–368 — behavior unchanged).
Browser
Chrome
Operating System
No response
Additional Context
The two behaviors involved are each intentional; the defect is their interaction:
_focusin selects the whole value (setSelectionRange(0, this.value.length)) — correct for a user-initiated focus.
_afterOpenPopover calls this.inner.focus() to return focus to the input after the popover opens — correct for keyboard flow.
The problem: the programmatic refocus in _afterOpenPopover fires _focusin, which cannot distinguish "user just focused the field" from "focus was bounced back during typing," so it select-all's mid-edit. Because the popover open is async, a keystroke can slip in after the select-all.
Suggested scoped fix (not a removal of either behavior): suppress the _focusin select-all when the focus is the programmatic return from _afterOpenPopover while typing is in progress (e.g. guard on an "actively typing" flag), or avoid resetting the selection on that specific refocus. This preserves the standard select-all-on-user-focus UX and the post-open focus handling.
Organization
SAP Kyma
Declaration
I’m not disclosing any internal or sensitive information.
Bug Description
When typing into a
ui5-combobox, opening the suggestions popover triggers a programmatic refocus of the inner input, which runs the "select entire value" logic intended for a fresh user focus. If a keystroke arrives during the asynchronous popover-open window, it lands on a fully-selected input and overwrites the value typed so far.Concretely, typing
defaultcharacter-by-character can end up asfault: afterde, type-ahead correctly completes todefaultand selects only the suffixfault; then the popover finishes opening, focus is handed back to the input, the selection expands to the wholedefault, and the next keystroke replaces everything.This is a timing/edge race — it predominantly affects fast or programmatic typing (e2e tools such as Cypress, possibly IME/paste sequences). A human typing at normal speed rarely hits the window, so it surfaces as a rare, hard-to-reproduce flake.
Affected Component
ComboBoxExpected Behaviour
Selecting-all on focus is correct for a genuine user focus. But when the popover-open sequence programmatically returns focus to the input during active typing, the in-progress value should be preserved — the remaining keystrokes should advance/append, not overwrite a newly select-all'd value.
Isolated Example
No response
Steps to Reproduce
ui5-comboboxwith several items, one of themdefault.defaultcharacter-by-character at a fast cadence (~10ms/char, as e2e tooling does), so a matching character opens the suggestions popover.fault), and the popover filters to nothing.Log Output, Stack Trace or Screenshots
combobox-focus-bug.mp4
Priority
Medium
UI5 Web Components Version
Observed on
2.24.0. Verified still present on the current latest2.27.2(ComboBox.js:_focusinline 341,_afterOpenPopoverlines 366–368 — behavior unchanged).Browser
Chrome
Operating System
No response
Additional Context
The two behaviors involved are each intentional; the defect is their interaction:
_focusinselects the whole value (setSelectionRange(0, this.value.length)) — correct for a user-initiated focus._afterOpenPopovercallsthis.inner.focus()to return focus to the input after the popover opens — correct for keyboard flow.The problem: the programmatic refocus in
_afterOpenPopoverfires_focusin, which cannot distinguish "user just focused the field" from "focus was bounced back during typing," so it select-all's mid-edit. Because the popover open is async, a keystroke can slip in after the select-all.Suggested scoped fix (not a removal of either behavior): suppress the
_focusinselect-all when the focus is the programmatic return from_afterOpenPopoverwhile typing is in progress (e.g. guard on an "actively typing" flag), or avoid resetting the selection on that specific refocus. This preserves the standard select-all-on-user-focus UX and the post-open focus handling.Organization
SAP Kyma
Declaration