From 1d99184ac74fa16746bcd3d209b7849999e6a7b0 Mon Sep 17 00:00:00 2001 From: Aleksandr Zhitnik Date: Fri, 5 Jan 2018 17:19:55 +0200 Subject: [PATCH] Use capture event to fix behavior in some situations --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 986fbc4..1a22b7b 100644 --- a/index.js +++ b/index.js @@ -53,7 +53,7 @@ exports = module.exports = { handler: handler, callback: binding.value } - !isServer(vNode) && document.addEventListener('click', handler) + !isServer(vNode) && document.addEventListener('click', handler, true) }, update: function (el, binding) { @@ -62,7 +62,7 @@ exports = module.exports = { unbind: function (el, binding, vNode) { // Remove Event Listeners - !isServer(vNode) && document.removeEventListener('click', el.__vueClickOutside__.handler) + !isServer(vNode) && document.removeEventListener('click', el.__vueClickOutside__.handler, true) delete el.__vueClickOutside__ } }