Skip to content

Horizontall scrolling on shift + mouse wheel scroll#2294

Merged
abose merged 2 commits intomainfrom
pluto/scroll-fix
Jun 18, 2025
Merged

Horizontall scrolling on shift + mouse wheel scroll#2294
abose merged 2 commits intomainfrom
pluto/scroll-fix

Conversation

@devvaannsh
Copy link
Copy Markdown
Member

@devvaannsh devvaannsh commented Jun 14, 2025

Scroll horizontally when mouse wheel is scrolled along with Shift key press.

Visual reference
https://github.com/user-attachments/assets/a55e2cbe-4e5d-4bbe-adec-59441741dca0

@abose abose requested a review from Copilot June 16, 2025 04:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds horizontal scrolling support via Shift+mouse wheel and trackpad gestures.

  • Adds conditional to detect Shift key or horizontal delta for scrolling left/right.
  • Applies horizontal scroll when relevant, preventing default vertical scroll.
  • Preserves vertical scroll behavior with scaling for custom line heights.
Comments suppressed due to low confidence (2)

src/editor/Editor.js:449

  • Add a test case to simulate Shift + wheel and horizontal trackpad gestures to verify that horizontal scrolling is correctly applied and vertical scrolling is suppressed.
if (event.shiftKey || event.deltaX !== 0) {

src/editor/Editor.js:449

  • [nitpick] Consider restricting horizontal scrolling to only when Shift is pressed (i.e., use if (event.shiftKey)), to avoid intercepting diagonal trackpad scrolls when the user intends vertical movement.
if (event.shiftKey || event.deltaX !== 0) {

@sonarqubecloud
Copy link
Copy Markdown

@abose abose merged commit f4437a5 into main Jun 18, 2025
17 of 22 checks passed
@abose abose deleted the pluto/scroll-fix branch June 18, 2025 14:28
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.

3 participants