Skip to content

Conversation

@RobinMalfait
Copy link
Member

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.
@vercel
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.

3 participants