Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to preventDefault inside passive event listener invocation. #519

Closed
1 task done
ajiho opened this issue Mar 22, 2023 · 3 comments · Fixed by #520
Closed
1 task done

Unable to preventDefault inside passive event listener invocation. #519

ajiho opened this issue Mar 22, 2023 · 3 comments · Fixed by #520
Assignees
Labels

Comments

@ajiho
Copy link

ajiho commented Mar 22, 2023

Checks

  • Not a duplicate.

Version

8.8.1

Description

原本是不会报错的,但是我用了这个方式,消除了另外一个js插件的控制台的警告
https://blog.csdn.net/qq_28378665/article/details/128757778

然后现在滚动的时候,控制台会报错,也许这是解决方案
https://blog.csdn.net/weixin_40716786/article/details/90675200

我已经在我的开源项目中使用smooth-scrollbar,在此非常感谢,还望尽快修复。


DeepL Translation:

Originally it would not have reported an error, but I used this to remove the warning from the console of another js plugin
https://blog.csdn.net/qq_28378665/article/details/128757778

Then now when scrolling, the console will report an error, maybe this is the solution
https://blog.csdn.net/weixin_40716786/article/details/90675200

I have used smooth-scrollbar in my open source project, thanks a lot here, also hope to fix it soon.


Steps to Reproduce

描述

Online Demo

No response

@idiotWu
Copy link
Owner

idiotWu commented Mar 22, 2023

We have already turned off the passive events, see:

eventListenerOptions = supportPassiveEvent ? { passive: false } as EventListenerOptions : false;

@idiotWu
Copy link
Owner

idiotWu commented Mar 22, 2023

Alright, I checked the default-passive-events package and found that they copy the original options using Object.assign(): https://github.com/zzarcon/default-passive-events/blob/664c0d25cdb81a4f78f589321e613971e8279cf8/src/index.js#L18-L24

So, we can probably solve this issue by defining the passive property as enumerable: true in our passive event support detection.

A patch is coming soon.

idiotWu added a commit that referenced this issue Mar 22, 2023
Fixes #519:
This modification ensures compatibility with the `default-passive-event`
package.
@idiotWu idiotWu self-assigned this Mar 22, 2023
@idiotWu idiotWu added the bug label Mar 22, 2023
idiotWu added a commit that referenced this issue Mar 23, 2023
Fixes #519:
This modification ensures compatibility with the `default-passive-event`
package.
@idiotWu
Copy link
Owner

idiotWu commented Mar 23, 2023

Fixed in v8.8.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants