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

--button-width incorrect when parent is rendered with an animation #3598

Open
RyanMcDonald opened this issue Dec 19, 2024 · 1 comment
Open

Comments

@RyanMcDonald
Copy link

What package within Headless UI are you using?

For example: @headlessui/react

What version of that package are you using?

For example: v2.2.0

What browser are you using?

Chrome

Reproduction URL

https://codesandbox.io/p/devbox/stupefied-rosalind-cfyp2k

Describe your issue
You can see in the repro URL I'm animating a Dialog that contains a Listbox, and the ListboxOptions don't take up the full width of the ListboxButton.

If an animation involving scale is used to show the content, --button-width is calculated before the animation finishes so it will be incorrect. The implementation of useElementSize uses a ResizeObserver, but that doesn't call the callback when its size changes via animation. It looks like the ResizeObserver's entry.borderBoxSize has the correct values, so maybe that would be an acceptable solution?

@abolajibisiriyu
Copy link

I have the same issue as well, I have a form rendered in a dialog

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

No branches or pull requests

2 participants