go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
45.25k stars 5.5k forks source link

Fix mermaid diagram height when initially hidden (#32457) #32464

Closed GiteaBot closed 1 week ago

GiteaBot commented 1 week ago

Backport #32457 by @silverwind

In a hidden iframe, document.body.clientHeight is not reliable. Use IntersectionObserver to detect the visibility change and update the height there.

Fixes: https://github.com/go-gitea/gitea/issues/32392

image