mirror of https://github.com/ElemeFE/element
Popover: show popper when InputNumber focused (#12284)
parent
3da485b617
commit
9c5b7e5fa1
|
@ -113,24 +113,7 @@ export default {
|
|||
on(reference, 'mouseleave', this.handleMouseLeave);
|
||||
on(popper, 'mouseleave', this.handleMouseLeave);
|
||||
} else if (this.trigger === 'focus') {
|
||||
let found = false;
|
||||
|
||||
if ([].slice.call(reference.children).length) {
|
||||
const children = reference.childNodes;
|
||||
const len = children.length;
|
||||
for (let i = 0; i < len; i++) {
|
||||
if (children[i].nodeName === 'INPUT' ||
|
||||
children[i].nodeName === 'TEXTAREA') {
|
||||
on(children[i], 'focusin', this.doShow);
|
||||
on(children[i], 'focusout', this.doClose);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (found) return;
|
||||
if (reference.nodeName === 'INPUT' ||
|
||||
reference.nodeName === 'TEXTAREA') {
|
||||
if (reference.querySelector('input, textarea')) {
|
||||
on(reference, 'focusin', this.doShow);
|
||||
on(reference, 'focusout', this.doClose);
|
||||
} else {
|
||||
|
@ -214,6 +197,8 @@ export default {
|
|||
off(reference, 'mousedown', this.doShow);
|
||||
off(reference, 'focusin', this.doShow);
|
||||
off(reference, 'focusout', this.doClose);
|
||||
off(reference, 'mousedown', this.doShow);
|
||||
off(reference, 'mouseup', this.doClose);
|
||||
off(reference, 'mouseleave', this.handleMouseLeave);
|
||||
off(reference, 'mouseenter', this.handleMouseEnter);
|
||||
off(document, 'click', this.handleDocumentClick);
|
||||
|
|
Loading…
Reference in New Issue