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

Expose the --button-width CSS variable on the PopoverPanel component #3058

Merged
merged 5 commits into from
Mar 26, 2024

Conversation

RobinMalfait
Copy link
Collaborator

This PR exposes the --button-width CSS variable on the PopoverPanel component, similar to all are other components that accept an anchor prop.

Currently we require a `MutableRefObject<HTMLElement | null>`, but in
some situations (Popover) we don't have a ref, but the direct element.

This now supports passing in both.

Another fix could be to wrap the raw value in a ref but that feels like
an incorrect workaround.
This is necessary because jsdom doesn't implement `ResizeObserver` and
then it would just crash.
Copy link

vercel bot commented Mar 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
headlessui-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 26, 2024 5:34pm
headlessui-vue ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 26, 2024 5:34pm

The `instanceof HTMLElement` cannot be used because this also runs on
the server where `HTMLElement` is not available as a concrete class.
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.

None yet

2 participants