Skip to content

Fix page scroll blocked when hovering over terminal demo#33

Merged
to-be-coder merged 1 commit intomainfrom
jess/tho-141-scroll-wheel-for-page-scroll-doesnt-work-when-hovering-over
Mar 24, 2026
Merged

Fix page scroll blocked when hovering over terminal demo#33
to-be-coder merged 1 commit intomainfrom
jess/tho-141-scroll-wheel-for-page-scroll-doesnt-work-when-hovering-over

Conversation

@to-be-coder
Copy link
Copy Markdown
Collaborator

@to-be-coder to-be-coder commented Mar 21, 2026

Summary

  • The wheel event handler on the canvas was unconditionally calling e.preventDefault(), which blocked native page scrolling whenever the mouse was over a gridland canvas (e.g. the terminal demo on the docs site)
  • Removed the preventDefault() call and switched to a passive wheel listener, so page scroll works normally while TUI scroll events still dispatch to renderables

Future consideration

If a component needs to own scroll (e.g. a scrollable list or chat window), it should opt in by calling event.preventDefault() on the TUI MouseEvent in its scroll handler. The browser-renderer can then check tuiEvent.defaultPrevented and conditionally block page scroll. This keeps the default behavior permissive and avoids breaking page scroll for components that don't need it.

Test plan

  • Open docs site, hover over the terminal demo window, scroll — page should scroll normally
  • Verify any TUI components with scroll handlers (e.g. chat) still receive scroll events

🤖 Generated with Claude Code

@to-be-coder to-be-coder requested a review from cjroth March 21, 2026 03:11
@cjroth cjroth temporarily deployed to jess/tho-141-scroll-wheel-for-page-scroll-doesnt-work-when-hovering-over - website PR #33 March 21, 2026 03:11 — with Render Destroyed
@to-be-coder to-be-coder changed the title ready for review - scroll-wheel-for-page-scroll-doesnt-work-when-hove… Fix page scroll blocked when hovering over terminal demo Mar 21, 2026
@to-be-coder to-be-coder merged commit 26bab95 into main Mar 24, 2026
2 checks passed
@to-be-coder to-be-coder deleted the jess/tho-141-scroll-wheel-for-page-scroll-doesnt-work-when-hovering-over branch March 24, 2026 15:57
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.

2 participants