Skip to content

Commit

Permalink
🐛 close dropdown on outside click
Browse files Browse the repository at this point in the history
  • Loading branch information
harshzalavadiya committed Jul 29, 2020
1 parent 1caae76 commit bbb9560
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-multi-select-component",
"version": "3.0.0",
"version": "3.0.1",
"description": "Simple and lightweight multiple selection dropdown component with checkboxes, search and select-all",
"author": "Harsh Zalavadiya",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/multi-select/dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const Dropdown = ({
const handleFocus = () => !hasFocus && setHasFocus(true);

const handleBlur = (e) => {
if (!e.relatedTarget) {
if (!e.currentTarget.contains(e.relatedTarget)) {
setHasFocus(false);
setExpanded(false);
}
Expand Down

0 comments on commit bbb9560

Please sign in to comment.