Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

Fix editor wheel scrolling over long wrapped lines#3792

Open
shriram-svg wants to merge 1 commit into
BoostIO:masterfrom
shriram-svg:fix-issue-2104-long-code-scroll
Open

Fix editor wheel scrolling over long wrapped lines#3792
shriram-svg wants to merge 1 commit into
BoostIO:masterfrom
shriram-svg:fix-issue-2104-long-code-scroll

Conversation

@shriram-svg
Copy link
Copy Markdown

@shriram-svg shriram-svg commented May 11, 2026

Description

Fixes #2104.

Markdown edit mode can lose mouse-wheel scrolling when the wheel event starts over a long wrapped line, such as a fenced code block line over the reported threshold. This adds a small CodeMirror wheel fallback: after a wheel event, if the editor scroller did not move at all, it applies the normalized vertical wheel delta through editor.scrollTo. Native/CodeMirror scrolling still wins whenever it handled the event.

The browser-specific delta normalization is isolated in browser/lib/wheelScroll.js and covered with unit tests.

Issue fixed

Type of changes

  • 🔘 Bugfix (Change that fixed an issue)
  • ⚪ Breaking change (Change that can cause existing functionality to change)
  • ⚪ Improvement (Change that improves the code. Maybe performance or development improvement)
  • ⚪ Feature (Change that adds new functionality)
  • ⚪ Documentation change (Change that modifies documentation. Maybe typo fixes)

Verification

  • NODE_PATH=/Users/shriramvasudevan/worktrees/bounties/boostnote-2847/node_modules PATH=/Users/shriramvasudevan/worktrees/bounties/boostnote-2847/node_modules/.bin:$PATH jest tests/lib/wheel-scroll.test.js --runInBand
  • NODE_PATH=/Users/shriramvasudevan/worktrees/bounties/boostnote-2847/node_modules PATH=/Users/shriramvasudevan/worktrees/bounties/boostnote-2847/node_modules/.bin:$PATH eslint browser/lib/wheelScroll.js browser/components/CodeEditor.js tests/lib/wheel-scroll.test.js
  • git diff --check

yarn lint still fails on the existing baseline, mostly styleName being reported as an unknown React property and unrelated Prettier findings.

Checklist:

  • 🔘 My code follows the project code style
  • 🔘 I have written test for my code and it has been tested
  • ⚪ All existing tests have been passed
  • ⚪ I have attached a screenshot/video to visualize my change if possible
  • 🔘 This PR will modify the UI or affects the UX
  • ⚪ This PR will add/update/delete a keybinding

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No scrolling in edit mode when code block has any line with over 150 characters

2 participants