Popover: fix focus trigger, fixed #734

pull/737/head
qingwei.li 2016-10-31 11:12:11 +08:00
parent 135c8ed45b
commit 482e78addc
2 changed files with 15 additions and 6 deletions

View File

@ -1,5 +1,11 @@
## 更新日志
### 1.0.0-rc.9
*2016-11-xx*
- 新增 MessageBox 确定按钮自动获取焦点, #721
- 修复 Popover focus 失效, #734
- 修复 Clickoutside 报错, #729
### 1.0.0-rc.8
*2016-10-28*

View File

@ -68,21 +68,24 @@ export default {
on(reference, 'mouseleave', this.handleMouseLeave);
on(popper, 'mouseleave', this.handleMouseLeave);
} else {
let found = false;
if ([].slice.call(reference.children).length) {
const children = reference.childNodes;
for (let i = 0; i < children.length; i++) {
const len = children.length;
for (let i = 0; i < len; i++) {
if (children[i].nodeName === 'INPUT' ||
children[i].nodeName === 'TEXTAREA') {
on(children[i], 'focus', () => { this.showPopper = true; });
on(children[i], 'blur', () => { this.showPopper = false; });
found = true;
break;
}
}
} else if (
reference.nodeName === 'INPUT' ||
reference.nodeName === 'TEXTAREA'
) {
}
if (found) return;
if (reference.nodeName === 'INPUT' ||
reference.nodeName === 'TEXTAREA') {
on(reference, 'focus', () => { this.showPopper = true; });
on(reference, 'blur', () => { this.showPopper = false; });
} else {