Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/composables/click-outside.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
export default {
beforeMount(el, binding, vnode, prevVnode) {
el.clickOutsideEvent = function (event) {
// here I check that click was outside the el and his children
// here I check that click was outside the element and its children
if (!(el == event.target || el.contains(event.target))) {
// and if it did, call method provided in attribute value
binding.value(event, el);
}
};
document.body.addEventListener("click", el.clickOutsideEvent);
},
// eslint-disable-next-line no-unused-vars
unmounted(el, binding, vnode, prevVnode) {
document.body.removeEventListener("click", el.clickOutsideEvent);
},
Expand Down