fix: ignore secondary scrollbar mouse buttons - #381
Conversation
|
@nrps9909 is attempting to deploy a commit to the afc163's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. Walkthrough滚动条现在只处理主鼠标按钮事件。轨道和滑块会忽略右键按下,不再阻止默认行为、滚动轨道或启动拖动状态。测试覆盖轨道与滑块的右键行为。 Changes滚动条鼠标按钮处理
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change prevents secondary mouse buttons from consuming scrollbar events or starting thumb drags while preserving primary-button behavior. It is localized, validated by regression coverage and passing checks, and no actionable merge-blocking risk remains. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files. ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Problem
The track handler checked
event.buttononly after callingpreventDefaultandstopPropagation, so right-click was still consumed. The thumb handler did not check the button at all, which made a right-click start a drag and disable pointer events on the list holder.Testing
a573364: the track right-click was alreadydefaultPreventednpm test -- tests/scroll.test.js --runInBand(38 passed)npm test -- --runInBand(8 suites, 281 tests passed)npm run tscnpm run lint(0 errors; 14 pre-existing hook warnings)npm run compile(ESM, CJS, and declarations)git diff --checkOverlap audit
PR #380 adds wheel-delta tests in the same test file but does not touch the scrollbar mouse handlers. The only open PRs touching
ScrollBar.tsx, #158 and #199, are conflicting branches from 2021 and 2023 covering scrollbar visibility and a broad horizontal-mode refactor; neither handles non-primary mouse buttons.AI assistance disclosure: Codex was used to trace the scrollbar input paths, implement and validate the exact-base regression and fix, audit current open PR overlap, and draft this PR. All stated behavior and test results were verified locally.
Summary by CodeRabbit