Skip to content

Let the wheel scroll inner scroll containers in comment mode - #16

Merged
mssh21 merged 1 commit into
mainfrom
claude/comment-mode-inner-scroll
Oct 16, 2026
Merged

mssh21 merged 1 commit into
mainfrom
claude/comment-mode-inner-scroll

Conversation

@mssh21

@mssh21 mssh21 commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • In comment mode the fixed selection cover receives every wheel event, so the browser only scrolled the cover's ancestors (the document). Pages that scroll inside an element could not be scrolled while commenting: an app shell under html, body { overflow: hidden } froze completely, and a scrolling table under the pointer stayed still while the document moved instead. This was reported on a React project, but the cause is the layout (CSS), not React.
  • The cover now hands the wheel to the nearest element under the pointer that can still scroll in that direction, through open shadow roots and accessible same-origin frames. The top document is still left to the browser so its native smooth scrolling is kept, and Ctrl+wheel (pinch or page zoom) is untouched.
  • docs/architecture.md describes the behaviour.

Checks

  • Reproduced in the React demo (demo/react.html) before the fix: with #root as the scroll container, the wheel moved nothing in comment mode (it scrolled 500 px outside comment mode); over the accounts table, the table stayed at 0 and the document scrolled.
  • After the fix in the same demo: #root scrolls, the table scrolls to its end, and clicking a cell after scrolling selects that cell.
  • New spec the wheel in comment mode scrolls a page whose content scrolls inside an app shell instead of the document (@cross-engine) failed in Chromium and WebKit before the fix and passes after it.
  • pnpm typecheck, pnpm test (512 passed), pnpm build, pnpm test:e2e (297 passed).

Notes

  • Touch scrolling on the cover is unchanged: the cover keeps touch-action: none so touch drags select an area.

🤖 Generated with Claude Code

The fixed selection cover received every wheel event, so the browser only
scrolled its ancestors (the document). Pages that scroll inside an element,
such as an app shell under a body with hidden overflow or a scrolling table,
could not be scrolled while commenting. The wheel is now handed to the nearest
element under the pointer that can still scroll in that direction, and the top
document keeps its native scrolling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mssh21
mssh21 merged commit 801cd3f into main Oct 16, 2026
3 checks passed
@mssh21
mssh21 deleted the claude/comment-mode-inner-scroll branch October 16, 2026 23:04
@mssh21 mssh21 mentioned this pull request Oct 16, 2026
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.

1 participant