mirror of https://github.com/ElemeFE/element
ClickOutside: fix 'Cannot read property target of undefined'
parent
8675c31e36
commit
45628ecbf3
|
@ -22,8 +22,10 @@ let startClick;
|
|||
export default {
|
||||
bind(el, binding, vnode) {
|
||||
const id = nodeList.push(el) - 1;
|
||||
const documentHandler = function(mouseup, mousedown) {
|
||||
const documentHandler = function(mouseup = {}, mousedown = {}) {
|
||||
if (!vnode.context ||
|
||||
!mouseup.target ||
|
||||
!mousedown.target ||
|
||||
el.contains(mouseup.target) ||
|
||||
(vnode.context.popperElm &&
|
||||
(vnode.context.popperElm.contains(mouseup.target) ||
|
||||
|
|
|
@ -146,7 +146,7 @@ describe('Dropdown', () => {
|
|||
done();
|
||||
}, 300);
|
||||
}, 300);
|
||||
});
|
||||
}).timeout(3000);
|
||||
it('hide on click', done => {
|
||||
vm = createVue({
|
||||
template: `
|
||||
|
|
|
@ -357,7 +357,7 @@ describe('Form', () => {
|
|||
}, 100);
|
||||
}, 100);
|
||||
});
|
||||
});
|
||||
}).timeout(3000);
|
||||
it('datepicker', done => {
|
||||
vm = createVue({
|
||||
template: `
|
||||
|
|
|
@ -293,7 +293,7 @@ describe('Menu', () => {
|
|||
done();
|
||||
}, 1000);
|
||||
}, 500);
|
||||
});
|
||||
}).timeout(3000);
|
||||
it('menu trigger click', done => {
|
||||
vm = createVue({
|
||||
template: `
|
||||
|
|
Loading…
Reference in New Issue