4f8c615245
* update tests to expose bug in React implementation * fix incorrect `active` state on mouseLeave The React code had a bug in the Listbox and Combobox components where it incorrectly made the first selected value the active value. The first selected option should be the active option when you open the listbox. However when you already had the component in an `open` state, hovered over a non-selected item and them left the option by moving it to the body then the first selected option became the active one again. This made sense because we used a `useEffect` in each option to make it the active one if it was also selected. Since every component re-renders, code got called and the bug arises. Now, instead we moved the logic to make it the active option to the reducer logic. We will check it when we register an option and doesn't have an active option index yet or when we open the Listbox/Combobox. This should also solve the strange scrolling behaviour where the options scroll up if you have more options than you display. * update changelog
@headlessui/react
A set of completely unstyled, fully accessible UI components for React, designed to integrate beautifully with Tailwind CSS.
Installation
# npm
npm install @headlessui/react
# Yarn
yarn add @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: