Skip to content

fix(live-editor): re-render preview on container resize#1859

Open
DHAWAN13 wants to merge 1 commit intomermaid-js:developfrom
DHAWAN13:fix-issue-5-preview-resize
Open

fix(live-editor): re-render preview on container resize#1859
DHAWAN13 wants to merge 1 commit intomermaid-js:developfrom
DHAWAN13:fix-issue-5-preview-resize

Conversation

@DHAWAN13
Copy link
Copy Markdown

Fix inconsistent preview rendering on resize

This PR fixes an issue where the Mermaid Live Editor preview
could fail to update or misalign nodes when the preview container
was resized or refreshed.

Changes

  • Observe preview container resize events
  • Re-render using the latest validated state
  • Preserve existing pan/zoom, rough mode, and render timing logic

This ensures consistent and reliable preview rendering without
altering the existing rendering pipeline.

@netlify
Copy link
Copy Markdown

netlify bot commented Dec 18, 2025

Deploy Preview for mermaidjs ready!

Name Link
🔨 Latest commit 258fb07
🔍 Latest deploy log https://app.netlify.com/projects/mermaidjs/deploys/694436f5b58fad000814a670
😎 Deploy Preview https://deploy-preview-1859--mermaidjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@sidharthv96
Copy link
Copy Markdown
Member

Please share a video of the difference in behaviour before and after the fix.
Also remove unrelated changes and AI generated comments from the code.

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