Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): properly animates height for dynamically rendered children #9665

Merged
merged 4 commits into from
Dec 2, 2024

Conversation

jacobsfletch
Copy link
Member

@jacobsfletch jacobsfletch commented Dec 2, 2024

Fixes #9567. When using the AnimateHeight component on a patched browser such as Webkit, components with dynamically rendered children are not properly animating in, such as blocks with rich text. This is because the height of that content is unable to be calculated before it's rendered, preventing the component from acquiring a target height to animate toward. This change was originally introduced in #9456 in effort to remove unnecessary dependencies.

The fix is to setup a ResizeObserver during animation to watch for changes to the content's height. This way, as components dynamically render in based on the "open" state, the hook will simply increment the target height accordingly.

@jacobsfletch jacobsfletch merged commit d04cea1 into main Dec 2, 2024
55 checks passed
@jacobsfletch jacobsfletch deleted the fix/animate-height-patch branch December 2, 2024 18:18
Copy link
Contributor

github-actions bot commented Dec 3, 2024

🚀 This is included in version v3.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI issues with block fields
1 participant