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
improvement(components): @touchstart @touchmove @wheel add passive #16741
base: dev
Are you sure you want to change the base?
Conversation
👋 @warmthsea, thank you for contributing element-plus. |
Hello @warmthsea, thank you for contributing to element-plus, please see our guideline to see how to make contribution |
🧪 Playground Preview: https://element-plus.run/?pr=16741 |
I have another question: |
The
|
useEventListener(sliderWrapper, 'touchmove', onSliderWrapperPrevent, { | ||
passive: false, | ||
}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be merged here, useEventListener
supports setting multiple events.
There is another question. To prevent SSR errors, maybe we should put the event binding logic in onMounted
hook. 🤔
passive: false, | ||
}) | ||
}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useEventListener(sliderWrapper, ['touchstart', 'touchmove'], [onSliderWrapperPrevent, onSliderWrapperPrevent], { passive: false }) |
After: