Skip to content

Commit

Permalink
fix(click-outside): correctly remove event handlers in Shadow DOM
Browse files Browse the repository at this point in the history
Use beforeUnmount instead of unmounted to remove event handlers in
click-outside directive, since it's not possible to get element's
shadowRoot when the element is already unmounted.

fixes vuetifyjs#19616
  • Loading branch information
cgodo committed Aug 2, 2024
1 parent bbcb173 commit f3b07de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vuetify/src/directives/click-outside/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const ClickOutside = {
}
},

unmounted (el: HTMLElement, binding: ClickOutsideDirectiveBinding) {
beforeUnmount (el: HTMLElement, binding: ClickOutsideDirectiveBinding) {
if (!el._clickOutside) return

handleShadow(el, (app: HTMLElement) => {
Expand Down

0 comments on commit f3b07de

Please sign in to comment.