-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Open
Labels
scope: autocompleteChanges related to the autocomplete. This includes ComboBox.Changes related to the autocomplete. This includes ComboBox.type: bugIt doesn't behave as expected.It doesn't behave as expected.
Description
Steps to reproduce
To reproduce : https://mui.com/material-ui/react-autocomplete/#playground => variante openOnFocus
Steps:
- Open the Autocomplete input (openOnFocus=true) by clicking into the input so the popup is visible.
- Switch to a different window (e.g. click another application / another browser window) so the current window loses focus.
- Return to the original window by clicking in the area where the popup options were displayed (i.e. where an option would be under the pointer).
- Observe that the popup reopens on focus regain and the click can select the option under the pointer (worst case).
Current behavior
When the window regains focus via a click, Autocomplete reopens the popup due to openOnFocus.
Because the popup is rendered immediately under the pointer, the same click can end up selecting an option (worst case) or reopening the popup unexpectedly.
This is especially problematic when the popup overlaps other UI controls (e.g. a Save button): the user's click intended to interact with the underlying UI is intercepted by the reopened popup and may change the selection.
Expected behavior
Regaining window focus via click should not cause the popup to reopen.
Context
No response
Your environment
npx @mui/envinfo
Browser :
Chrome et Edge
System:
OS: Linux 5.0 undefined
Binaries:
Node: 20.19.1 - /usr/local/bin/node
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
Browsers:
Chrome: Not Found
Firefox: Not Found
npmPackages:
@emotion/react: latest => 11.14.0
@emotion/styled: latest => 11.14.1
@mui/core-downloads-tracker: 7.3.7
@mui/material: latest => 7.3.7
@mui/private-theming: 7.3.7
@mui/styled-engine: 7.3.7
@mui/system: 7.3.7
@mui/types: 7.4.10
@mui/utils: 7.3.7
@types/react: latest => 19.2.9
react: latest => 19.2.3
react-dom: latest => 19.2.3
typescript: latest => 5.9.3
Search keywords: Autocomplete openOnFocus window focus blur click unintended selection popper
Metadata
Metadata
Assignees
Labels
scope: autocompleteChanges related to the autocomplete. This includes ComboBox.Changes related to the autocomplete. This includes ComboBox.type: bugIt doesn't behave as expected.It doesn't behave as expected.
