Skip to content

Commit

Permalink
Merge pull request #1 from kogosoftwarellc/pr-dropdown-closing-on-scr…
Browse files Browse the repository at this point in the history
…ollbar-click

Merging furqanZafar#194
  • Loading branch information
jsdevel authored Jan 5, 2021
2 parents 36dc6e8 + 6664add commit dfabd83
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/ReactSelectize.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,17 @@
return this$.props.onFocus(e);
});
}, ref$.onBlur = function(e){
if (this$.refs.dropdownMenu && document.activeElement === findDOMNode(this$.refs.dropdownMenu)) {
return;
dropdownDOMNode = findDOMNode(this$.refs.dropdownMenu);

if (dropdownDOMNode) {
const dropDownClassName = dropdownDOMNode.classList[0];
if (document.activeElement.isEqualNode(dropdownDOMNode)) {
return;
} else if (!!document.querySelector(`.${dropDownClassName}:hover`)) {
return this$.refs.search.focus();
}
}

return this$.closeDropdown(function(){
return this$.props.onBlur(e);
});
Expand Down

0 comments on commit dfabd83

Please sign in to comment.