-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
good first issueGreat for first contributions. Enable to learn the contribution process.Great for first contributions. Enable to learn the contribution process.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
Steps:
- Open this link to live example: https://stackblitz.com/edit/github-dy1275cl?file=src%2FApp.tsx
- With either of the Autocomplete fields in focus press ArrowLeft
- This happens if there is input text in the field or not as long as no value has been set.
- Observe error in console.
This is reproducible on the doc site as well with the same steps: https://mui.com/material-ui/react-autocomplete/#single-value-rendering
Uncaught TypeError: can't access property "focus", anchorEl.querySelector(...) is null
focusItem @mui_material_Autocomplete.js:278
useEventCallback chunk-KPQAQXG2.js:35
handleKeyDown @mui_material_Autocomplete.js:717
executeDispatch react-dom_client.js:13620
runWithFiberInDEV react-dom_client.js:997
processDispatchQueue react-dom_client.js:13656
dispatchEventForPluginEventSystem react-dom_client.js:14069
batchedUpdates$1 react-dom_client.js:2624
dispatchEventForPluginEventSystem react-dom_client.js:13761
dispatchEvent react-dom_client.js:16782
dispatchDiscreteEvent react-dom_client.js:16763
addTrappedEventListener react-dom_client.js:13726
listenToNativeEvent react-dom_client.js:13685
listenToAllSupportedEvents react-dom_client.js:13696
listenToAllSupportedEvents react-dom_client.js:13695
createRoot react-dom_client.js:20131
<anonymous> main.tsx:5
3 @mui_material_Autocomplete.js:278:16
Current behavior
An error is thrown.
Expected behavior
No error is thrown.
Context
No response
Your environment
Search keywords: arrowleft autocomplete typeerror "cannot read property focus"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGreat for first contributions. Enable to learn the contribution process.Great for first contributions. Enable to learn the contribution process.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.