Skip to content

Commit d7e2720

Browse files
committed
1 parent 36dc6e8 commit d7e2720

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/ReactSelectize.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,23 @@
147147
return this$.props.onFocus(e);
148148
});
149149
}, ref$.onBlur = function(e){
150+
/*
150151
if (this$.refs.dropdownMenu && document.activeElement === findDOMNode(this$.refs.dropdownMenu)) {
151152
return;
152153
}
154+
*/
155+
156+
dropdownDOMNode = findDOMNode(this$.refs.dropdownMenu);
157+
158+
if (dropdownDOMNode) {
159+
const dropDownClassName = dropdownDOMNode.classList[0];
160+
if (document.activeElement.isEqualNode(dropdownDOMNode)) {
161+
return;
162+
} else if (!!document.querySelector(`.${dropDownClassName}:hover`)) {
163+
return this$.refs.search.focus();
164+
}
165+
}
166+
153167
return this$.closeDropdown(function(){
154168
return this$.props.onBlur(e);
155169
});

0 commit comments

Comments
 (0)