[Autocomplete] openOnFocus is not working properly
See original GitHub issue- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
The popup opens even when openOnFocus
is set to false
which is the default value according to Autocomplete
api doc
But if you focus towards the end of the input, it’s not opening the popup - i.e., working as expected
Expected Behavior 🤔
The popup should not open when openOnFocus
is set to false no matter where the user focuses in the input.
Steps to Reproduce 🕹
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:14 (6 by maintainers)
Top Results From Across the Web
[Autocomplete] openOnFocus is not working properly #20286
The issue is present in the latest release. I have searched the issues of this repository and believe that this is not a...
Read more >MUI Autocomplete: How to prevent open on focus, instead ...
Below is a working example of one way to do this. This specifies the onOpen, onClose, onInputChange, open, and inputValue props in addition...
Read more >Autocomplete API - Material UI - MUI
Name Type Default
options * array
renderInput * func
autoComplete bool false
Read more >Autocomplete - Buefy
Autocomplete. Extended input that provide suggestions while the user types. Use with Field to access all functionalities. CodePen. Selected:.
Read more >Filtering results with tags | Autocomplete - Algolia
Setting openOnFocus to true ensures that the dropdown appears as soon as a user focuses the input. For now, plugins is an empty...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
useAutomplete.js:868
is responsible of opening the popup, and it doesn’t checkopenOnFocus
value.It would be cool if
handleInputChange
checkedopen
state value before opening popup indicator (check here)I got a workaround by using
onMouseDownCapture={(e) => e.stopPropagation()}}
on the<Input>
, but it would be nice to fix it.There is a padding around input field by default due to which you can focus just outside
<input>
but well inside what appears to be thetextbox
for autocomplete. If you focus in that padding area the popup opens ifopenOnFocus
is set totrue
and doesn’t open ifopenOnFocus
is set tofalse
i.e., working as expected. But if you focus inside<input>
, the popup’s opening even if you setopenOnFocus
tofalse
.