-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use capture event to fix behavior in some situations #10
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will allow people to choose what they want to use.
v-click-outside.capture="hide"
@@ -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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!isServer(vNode) && document.removeEventListener('click', el.__vueClickOutside__.handler, true) | |
!isServer(vNode) && document.removeEventListener('click', el.__vueClickOutside__.handler, !!binding.modifiers.capture) |
@@ -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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!isServer(vNode) && document.addEventListener('click', handler, true) | |
!isServer(vNode) && document.addEventListener('click', handler, !!binding.modifiers.capture) |
No description provided.