Skip to content

Commit

Permalink
Fix event deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
cbravobernal committed May 6, 2024
1 parent d57523d commit a818956
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/interactivity/src/directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ const getGlobalEventDirective = ( type ) => {
.forEach( ( entry ) => {
const event = entry.suffix.split( '--', 1 )[ 0 ];
useInit( () => {
const cb = () => evaluate( entry, event );
const cb = ( cbEvent ) => evaluate( entry, cbEvent );
const globalVar = type === 'window' ? window : document;
globalVar.addEventListener( event, cb );
return () => globalVar.removeEventListener( event, cb );
Expand Down

0 comments on commit a818956

Please sign in to comment.