Commit 45628ecb authored by Leopoldthecoder's avatar Leopoldthecoder Committed by 杨奕

ClickOutside: fix 'Cannot read property target of undefined'

parent 8675c31e
......@@ -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: `
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment