Feature/ dropdown close onBlur
See original GitHub issueIssue description
- components:
Dropdown
It would be sweet to add closeOnBlur
prop to dropdown.
The result:
If closeOnBlur={false}
user my trigger dropdown toggle to close dropdown.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
How to hide a dropdown when the user clicks outside of it
If I use onblur , it successfully hides the dropdown, but if you click on an option it doesn't populate the input, this...
Read more >option for manually closing dropdown menu when onBlur #1615
Is it possible to have a function to allow user manually closing the dropdown instead of closing it automatically when blurring?
Read more >React Dropdown (onBlur) - CodePen
This example uses an XML-like syntax called JSX. Input data that is passed into the component can be accessed by render() via this.props....
Read more >Element: blur event - Web APIs | MDN
The blur event fires when an element has lost focus. The event does not bubble, but the related focusout event that follows does...
Read more >Dismissing a React Dropdown Menu by Clicking Outside its ...
The onBlur callback is called only after the dropdown menu gets the focus. If the action of clicking outside the component occurs before...
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
keyup
happens when there is something else on the page which can be focused, allowing <kbd>tab</kbd> to blur and trigger toggle. The event target may also give some insight. https://stackblitz.com/edit/reactstrap-v5-beta-starter-7mgu2c?file=index.jsSlick, using that logic you could not close the dropdown. If added to reactstrap, should probably just be added to the
UncontrolledDropdown
.