Skip to content

Conversation

@RobinMalfait
Copy link
Member

This PR changes the default tags for the following components:

  • Use div as default tag for ListboxOptions and ListboxOption components
  • Use div as default tag for ComboboxOptions and ComboboxOption components

These were using ul and li respectively, which means that if you used as="div" on one of them, that you would have to use as="div" on the other but that's not always clear and nothing will break or throw an error if you do. It would just be incorrect HTML.

We already set a custom role attribute, so the default role we get from ul/li elements was overwritten anyway.

  • Use div as default tag for TabGroup
    In a lot of places an additional wrapper element OR as="div" was requirement for layout such as constraining the width. Making the TabGroup as div by default will make it easier to do that.

These are better defaults for these components for Headless UI v2.

@vercel
Copy link

vercel bot commented Apr 18, 2024

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

Name Status Preview Comments Updated (UTC)
headlessui-react ❌ Failed (Inspect) Apr 18, 2024 11:48pm
headlessui-vue ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 18, 2024 11:48pm

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.

2 participants