From 8f060fe81f5d60562d8fbacd6b48e6df3d342b2d Mon Sep 17 00:00:00 2001 From: Dolphin Wood Date: Wed, 22 Mar 2023 15:07:08 -0400 Subject: [PATCH] fix(utils/event-hub): define `options.passive` as enumerable Fixes #519: This modification ensures compatibility with the `default-passive-event` package. --- src/utils/event-hub.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils/event-hub.ts b/src/utils/event-hub.ts index 12b7b750..7fb4a835 100644 --- a/src/utils/event-hub.ts +++ b/src/utils/event-hub.ts @@ -24,8 +24,10 @@ function getOptions(): typeof eventListenerOptions { try { const noop = () => {}; const options = Object.defineProperty({}, 'passive', { + enumerable: true, get() { supportPassiveEvent = true; + return true; }, }); window.addEventListener('testPassive', noop, options);