Skip to content

Commit

Permalink
fix(utils/event-hub): define options.passive as enumerable
Browse files Browse the repository at this point in the history
Fixes #519:
This modification ensures compatibility with the `default-passive-event`
package.
  • Loading branch information
idiotWu committed Mar 23, 2023
1 parent 02a0d81 commit 8f060fe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/utils/event-hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8f060fe

Please sign in to comment.