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

Change default tags for ListboxOptions, ListboxOption, ComboboxOptions, ComboboxOption and TabGroup components #3109

Merged
merged 4 commits into from
Apr 18, 2024

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.

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

@RobinMalfait RobinMalfait merged commit 83cda0a into main Apr 18, 2024
13 checks passed
@RobinMalfait RobinMalfait deleted the change/default-tags branch April 18, 2024 23:54
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.

1 participant