255fc36668
* ensure there is an animatable root node This is a bit sad, but it is how Vue works... We used to render just a simple PopoverPanel that resolved to let's say a `<div>`, that's all good. Because the native `<transition>` component requires that there is only 1 DOM child (regardless of the Vue "tree"). This is the sad part, because we simplified focus trapping for the Popover by introducing sibling hidden buttons to capture focus instead of managing this ourselves. Since we can't just return multiple items we wrap them in a `Fragment` component. If you wrap items in a Fragment, then a lot of Vue's magic goes away (automatically adding `class` to the root node). Luckily, Vue has a solution for that, which is `inheritAttrs: false` and then manually spreading the `attrs` onto the correct element. This all works beautiful, but not for the `<transition>` component... so... let's move the focus trappable elements inside the actual Panel and update the logic slightly to go to the Next/Previous item instead of the First/Last because the First/Last will now be the actual focus guards. * update changelog * make TypeScript a bit happier * improve `default` slot in `PopoverPanel`
@headlessui/react
A set of completely unstyled, fully accessible UI components for React, designed to integrate beautifully with Tailwind CSS.
Installation
npm install @headlessui/react
Documentation
For full documentation, visit headlessui.dev.
Community
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
For casual chit-chat with others using the library: