Skip to content

Home page embeds: plain wheel scrolls the page, Ctrl/Cmd + wheel zooms - #112

Merged
MarkPhamm merged 1 commit into
mainfrom
fix/98-embed-wheel
Nov 12, 2026
Merged

MarkPhamm merged 1 commit into
mainfrom
fix/98-embed-wheel

Conversation

@MarkPhamm

Copy link
Copy Markdown
Owner

Fixes #98

Cause. Both live viewers on the home page (the AdventureWorks DW tour and the dbt yml demo) are the real viewer in a same-origin iframe, so the canvas took every wheel event as zoom.

Fix. home.js wheelScrolls(ifr, stage), called by home-tour.js and home-embed.js once the iframe loads:

  • A capturing wheel listener on the iframe's window. A plain wheel over #canvas scrolls the home page instead.
  • Ctrl/⌘ + wheel and trackpad pinch (a ctrl wheel) still zoom.
  • The details panel and the explorer list still scroll as before.
  • A short "Use ⌘ + scroll to zoom" tip shows over the diagram (Ctrl off Mac), and the viewer's footer hint says the same.

The standalone viewer is unchanged: wheel zoom stays there.

Not changed

  • I couldn't reproduce the 7% start or the minimap under the details panel at 1126x800: the tour opens at 90% and the dbt demo at 100%, with the minimap beside the panel. I left both alone.

Verified. Playwright, system Chrome, 1126x800, local mkdocs build + gallery:

before after
tour, 3 plain wheels 90% -> 23%, page moved 0px stays 90%, page moved 400px (2 wheels), tip shown
dbt demo, 3 plain wheels 100% -> 26%, page moved 0px stays 100%, page moved 400px (2 wheels), tip shown
Ctrl + wheel zooms zooms (90% -> 33%, 100% -> 37%)

… pinch zooms.

Both live viewers on the home page took every wheel event as zoom, so
scrolling down the page shrank the diagram to a dot and the page never moved.
@github-actions

Copy link
Copy Markdown

Schema changes: origin/main → working tree

No schema changes.

Interactive diagram with changes highlighted: download the erd artifact from this run. Generated by qdbd.

@MarkPhamm
MarkPhamm merged commit 143d79a into main Nov 12, 2026
13 checks passed
@MarkPhamm
MarkPhamm deleted the fix/98-embed-wheel branch November 12, 2026 09:00
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.

Website: embedded live diagrams hijack the scroll wheel (zoom instead of page scroll)

1 participant