Skip to content

Commit 6664add

Browse files
committed
1 parent 36dc6e8 commit 6664add

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/ReactSelectize.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,17 @@
147147
return this$.props.onFocus(e);
148148
});
149149
}, ref$.onBlur = function(e){
150-
if (this$.refs.dropdownMenu && document.activeElement === findDOMNode(this$.refs.dropdownMenu)) {
151-
return;
150+
dropdownDOMNode = findDOMNode(this$.refs.dropdownMenu);
151+
152+
if (dropdownDOMNode) {
153+
const dropDownClassName = dropdownDOMNode.classList[0];
154+
if (document.activeElement.isEqualNode(dropdownDOMNode)) {
155+
return;
156+
} else if (!!document.querySelector(`.${dropDownClassName}:hover`)) {
157+
return this$.refs.search.focus();
158+
}
152159
}
160+
153161
return this$.closeDropdown(function(){
154162
return this$.props.onBlur(e);
155163
});

0 commit comments

Comments
 (0)