ericgio / react-bootstrap-typeahead

React typeahead with Bootstrap styling
http://ericgio.github.io/react-bootstrap-typeahead/
MIT License
1.01k stars 408 forks source link

Can't catch any outside click event to close the dropdown #771

Closed Amir-Inbar closed 1 year ago

Amir-Inbar commented 1 year ago

I used the AsyncTypeahead, and I tried the use a multi-choice and keep the dropdown open until I press outside click, similar behavior example: https://codesandbox.io/s/rbt-keep-menu-open-during-multi-select-nr2y4?file=/src/index.js

OnBlur and onFocus don't work as well, please advice how to fix the issue or to support with another solution to keep the dropdown open until the user selects his options and clicks outside the dropdown.

Thanks

ericgio commented 1 year ago

Hey @Amir-Inbar, a similar approach should work for async. See this example.

Amir-Inbar commented 1 year ago

Amazing, thank you!