fix(scroll): axis-intent wheel detection for Windows diagonal scroll#28
fix(scroll): axis-intent wheel detection for Windows diagonal scroll#28shiqkuangsan merged 1 commit intomainfrom
Conversation
Replace the naive `deltaX !== 0` early return with axis-intent classification that tolerates mixed-axis input from Windows Precision Touchpads and high-resolution mice. Also normalize deltaMode to pixels for consistent scroll speed across platforms.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe wheel-to-horizontal scrolling handler now supports both mouse wheel and trackpad gestures. It normalizes deltaX and deltaY values using deltaMode, detects axis intent, bypasses native handling for keyboard modifiers, and updates boundary logic and scroll calculations to use normalized values instead of raw inputs. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
🤔 This is a ...
🔗 Related Issues
User feedback: Windows 11 mouse wheel scrolling in grouped mode feels "diagonal" — items scroll at an angle instead of purely horizontal.
💡 Background and Solution
Root cause: The
onRowWheelhandler useddeltaX !== 0as an early return to let native handle trackpad input. However, Windows Precision Touchpads and high-resolution mice producewheelevents with bothdeltaXanddeltaYnon-zero simultaneously (per W3C spec). Combined with nested scroll containers (inner horizontalGroupRow+ outer vertical group list), the browser splits the mixed-axis event across both layers → diagonal scrolling.Fix:
deltaX !== 0early return with axis-intent detection:|deltaX| > |deltaY|→ native (trackpad horizontal swipe), otherwise intercept and convert to horizontal scrolldeltaModenormalization to pixels (line=40px, page=800px) for consistent scroll speed across platformsctrlKeypassthrough to avoid interfering with zoom🧪 Test Plan
pnpm test) — 270 passednpx tsc --noEmit)📝 Changelog
Summary by CodeRabbit