Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix event deletion
Browse files Browse the repository at this point in the history
cbravobernal committed May 6, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
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
@@ -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 );

0 comments on commit a818956

Please sign in to comment.