[Bug] Suggestions not rendered when using onFocus for input in renderInputComponent
See original GitHub issueAre you reporting a bug?
Yes
-
Please create a Codepen that demonstrates your issue. You can start from the [Basic example] CodePen link
-
Steps to reproduce the issue
- Focus on the input field
- Type
c
, and wait for suggestions to appear
Observed behaviour: Suggestions does not open
Expected behaviour: Suggestions should open
If you go ahead and remove the onFocus
prop from the input(line 88) it would work as expected.
Thanks.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
focusInputOnSuggestionClick throwing error when ... - GitHub
Create an input using renderInputComponent; Create a ref to the input on the class ... No more error and everything is working correctly....
Read more >reactjs - Autosuggest/Combobox suggestion wont display
In getSuggestions you need to return an array directly, not an object. see https://codesandbox.io/s/w04jpzjr4k.
Read more >React Autosuggest
When the suggestions list is long, you may want to make it scrollable. Note that the suggestions are rendered even when the input...
Read more >Focus management with Vue refs - Learn web development
It's important to note that a ref needs to be unique within a component. No two elements rendered at the same time should...
Read more >3 ways to autofocus an input in React that ALMOST always work!
Deep dive into the autofocus attribute, the focus() method, the autoFocus prop, the useRef hook and callback refs.
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 Free
Top 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
@apandichi the workaround works on my end - thanks a ton! 😃
The bad news is: the same problem happens with onChange instead of onFocus. The good news is: there is a workaround.