@@ -113,24 +113,7 @@ export default {
113
113
on (reference, ' mouseleave' , this .handleMouseLeave );
114
114
on (popper, ' mouseleave' , this .handleMouseLeave );
115
115
} else if (this .trigger === ' focus' ) {
116
- let found = false ;
117
-
118
- if ([].slice .call (reference .children ).length ) {
119
- const children = reference .childNodes ;
120
- const len = children .length ;
121
- for (let i = 0 ; i < len; i++ ) {
122
- if (children[i].nodeName === ' INPUT' ||
123
- children[i].nodeName === ' TEXTAREA' ) {
124
- on (children[i], ' focusin' , this .doShow );
125
- on (children[i], ' focusout' , this .doClose );
126
- found = true ;
127
- break ;
128
- }
129
- }
130
- }
131
- if (found) return ;
132
- if (reference .nodeName === ' INPUT' ||
133
- reference .nodeName === ' TEXTAREA' ) {
116
+ if (reference .querySelector (' input, textarea' )) {
134
117
on (reference, ' focusin' , this .doShow );
135
118
on (reference, ' focusout' , this .doClose );
136
119
} else {
@@ -214,6 +197,8 @@ export default {
214
197
off (reference, ' mousedown' , this .doShow );
215
198
off (reference, ' focusin' , this .doShow );
216
199
off (reference, ' focusout' , this .doClose );
200
+ off (reference, ' mousedown' , this .doShow );
201
+ off (reference, ' mouseup' , this .doClose );
217
202
off (reference, ' mouseleave' , this .handleMouseLeave );
218
203
off (reference, ' mouseenter' , this .handleMouseEnter );
219
204
off (document , ' click' , this .handleDocumentClick );
0 commit comments