Clarifying behavior of `shouldRenderSuggestions`
See original GitHub issueAre you reporting a bug? Yes
-
Steps
- Focus on the input field
- Type
c
, and wait for suggestions to appear - Notice the dropdown with custom footer.
- Delete
c
and instead enterd
- Dropdown doesn’t open. Note that
shouldRenderSuggestions
istrue
at this point.
Observed behaviour: Suggestions’ container are closed
Expected behaviour: Suggestions’ container should stay open, since
shouldRenderSuggestions
is returning true.
Essentially, I am trying to show a catch-all situation where if no results exist, the user can do something else. But the container isn’t opening when shouldRenderSuggestions
is true unless results
exists. That seems like contradictory behavior.
Thoughts?
And as always, thank you for keeping this library going!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
Top Results From Across the Web
MGMT6237 Final Flashcards - Quizlet
A theory that explains the most effective pattern of leadership behavior in ... Which of the following is not an example of clarifying...
Read more >MGT Final Flashcards | Chegg.com
A theory that explains the msot effective pattern of leadership behavior in ... which of the following is not an example of clarifying...
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
@oyeanuj I think I suffered from the same problem as you, and was able to solve this using the current Autosuggest solution.
In the below code, I ensure that the suggestions container always displays. Then, I use the renderSuggestionsContainer method to render any suggestions (when they exist), and if they don’t exist AND the query is > 1, I render something else in it’s place. Now, I get the desired effect of seeing “Add New Member” when no suggestions are returned.
@oyeanuj or @moroshko were you able to make any progress here? If not, I can take a look and potentially raise a PR. Just don’t want to do work if it was already done.