-
Notifications
You must be signed in to change notification settings - Fork 220
fix: 移动端交叉表滚动时,手指不松开持续滚动几秒后,表格滚动会带动整个网页一起滚动 #3280
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
base: next
Are you sure you want to change the base?
Conversation
|
你好 @Alexzjt,非常感谢你的贡献. Hello, @Alexzjt, Thanks for your contribution. In order to make the code more robust, please add the corresponding unit tests, and update the docs if there are API changes. |
Summary of ChangesHello @Alexzjt, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a specific bug where the browser's default scrolling behavior interfered with custom panning functionality, particularly in mobile contexts. By explicitly preventing the default action of wheel events when panning is active, the change ensures a smoother and more controlled user experience, aligning with the intended custom interaction. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request addresses an issue where panning on a mobile device was also causing the browser page to scroll. The fix correctly introduces a call to preventDefault() on the native pointer move event during a panning gesture. This prevents the browser's default scroll behavior. The overall approach is sound. I have one minor suggestion to improve the code's clarity and correctness by removing an unnecessary optional chaining operator.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## next #3280 +/- ##
==========================================
+ Coverage 75.77% 79.08% +3.31%
==========================================
Files 257 222 -35
Lines 11994 12196 +202
Branches 2464 2741 +277
==========================================
+ Hits 9088 9645 +557
+ Misses 1398 892 -506
- Partials 1508 1659 +151 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Size Change: +163 B (+0.02%) Total Size: 720 kB
ℹ️ View Unchanged
|
56d179e to
75d2005
Compare
|
/gemini review |
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.
Code Review
本次 PR 旨在解决移动端滚动穿透的问题。通过引入 shouldPreventDefault 回调函数来控制 event.preventDefault() 的调用时机,模拟了 CSS overscroll-behavior 的行为,这是一个合理的解决方案。实现上将 preventDefault 的调用提前,以兼容移动端浏览器普遍使用的 passive event listener,这也是正确的处理方式。此外,修改还包括在事件链中传递原生事件对象,以便进行更底层的控制。总体而言,这是一个高质量的修复。我提出了一些关于代码清晰度和类型安全性的次要建议,以供参考。
👀 PR includes
✨ Feature
🎨 Enhance
🐛 Bugfix
🔧 Chore
📝 Description
🖼️ Screenshot
Screenrecorder-2026-01-05-17-49-57-233.mp4
Screenrecorder-2026-01-05-17-46-02-933.mp4
🔗 Related issue link
🔍 Self-Check before the merge