Skip to content

Fix: Shift+Wheel scrolls horizontally instead of vertically - #838

Draft
m2a2x with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-shift-wheel-scroll-issue
Draft

Fix: Shift+Wheel scrolls horizontally instead of vertically#838
m2a2x with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-shift-wheel-scroll-issue

Conversation

Copilot AI commented May 1, 2026

Copy link
Copy Markdown

Some browsers (e.g. Yandex on Windows 11) dispatch WheelEvent with deltaY/shiftKey=true and deltaX=0 for Shift+Wheel, expecting the app to handle the axis conversion. RevoGrid was consuming deltaY vertically and then bailing out of the horizontal handler — resulting in vertical scroll until hitting the bottom, at which point native horizontal scroll took over.

Changes

src/components/scroll/revogr-viewport-scroll.tsx

  • Added shiftKey?: boolean to LocalScrollEvent
  • onVerticalMouseWheel: bail out early when shiftKey is set — let the horizontal handler own it
  • onHorizontalMouseWheel: compute effectiveDelta from deltaX if available, otherwise fall back to deltaY when shiftKey is held
// Before
if (!e.deltaX) return;

// After — Shift+Wheel with deltaY-only browsers now scrolls horizontally
const effectiveDelta = e.deltaX !== 0 ? e.deltaX : (e.shiftKey ? e.deltaY : 0);
if (!effectiveDelta) return;

e2e/scroll.spec.ts (new)

  • Asserts Shift+Wheel advances scrollLeft and leaves scrollTop unchanged
  • Asserts normal Wheel advances scrollTop and leaves scrollLeft unchanged

Copilot AI linked an issue May 1, 2026 that may be closed by this pull request
Copilot AI and others added 2 commits May 1, 2026 12:01
Some browsers (e.g. Yandex on Windows 11) send WheelEvents with deltaY
set but deltaX=0 when Shift is held, expecting the app to handle the
horizontal scroll conversion. This caused RevoGrid to scroll vertically
instead of horizontally.

- Add shiftKey to LocalScrollEvent type
- Skip vertical scroll in onVerticalMouseWheel when shiftKey is held
- Use deltaY as horizontal delta in onHorizontalMouseWheel when shiftKey
  is held and deltaX is 0
- Add e2e tests for Shift+Wheel and normal wheel scroll behavior

Agent-Logs-Url: https://github.com/revolist/revogrid/sessions/8669f3a8-d02f-4b90-a20d-b322c826019f

Co-authored-by: m2a2x <6465130+m2a2x@users.noreply.github.com>
@sonarqubecloud

sonarqubecloud Bot commented May 1, 2026

Copy link
Copy Markdown

Copilot AI changed the title [WIP] Fix horizontal scrolling issue with Shift + Wheel in Yandex Browser Fix: Shift+Wheel scrolls horizontally instead of vertically May 1, 2026
Copilot finished work on behalf of m2a2x May 1, 2026 12:03
Copilot AI requested a review from m2a2x May 1, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Shift + Wheel

2 participants