From a8189567d1001b02b32f704d6efe2ca2ea52d66d Mon Sep 17 00:00:00 2001 From: Carlos Bravo Date: Mon, 6 May 2024 22:10:34 +0200 Subject: [PATCH] Fix event deletion --- packages/interactivity/src/directives.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/interactivity/src/directives.js b/packages/interactivity/src/directives.js index c9a45001e6808c..fbab3f545fa4b6 100644 --- a/packages/interactivity/src/directives.js +++ b/packages/interactivity/src/directives.js @@ -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 );