Skip to content

Commit

Permalink
Fix scroll over mermaid frame (#21925)
Browse files Browse the repository at this point in the history
When starting a scroll while the mouse is over a mermaid diagram, the
scroll sometimes propagates to the iframe, preventing the parent page
from scrolling. Fix this by disabling scroll inside the iframe. This is
not a problem because those frames are never meant to scroll. Bug seems
to affect Firefox only.


![scroll](https://user-images.githubusercontent.com/115237/203847578-6831e3c8-9df4-4577-8501-822fb9ea1278.gif)
  • Loading branch information
silverwind authored Nov 24, 2022
1 parent fc7a2d5 commit 9ce5e09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web_src/js/markup/mermaid.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const {mermaidMaxSourceCharacters} = window.config;

const iframeCss = `
:root {color-scheme: normal}
body {margin: 0; padding: 0}
body {margin: 0; padding: 0; overflow: hidden}
#mermaid {display: block; margin: 0 auto}
`;

Expand Down

0 comments on commit 9ce5e09

Please sign in to comment.