Expose 'close' functionality for Listbox(and other) components #1775
Joostdeboer
started this conversation in
Ideas
Replies: 1 comment
-
@Joostdeboer We did this #1779 (comment) for the Popover component. Hope it helps. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
At the moment of writing this, the only headlessui component that exposes a 'close' functionality to the user, such that you can manually close the component, is the Disclosure. However, while all the components have an 'open' boolean, they do not have access to a function to close the component, if applicable. For example, the Listbox would be one such component where having access to the 'close' function would be beneficial for developing custom elements.
In our use-case we would like to close the Listbox component on scrolling through the webpage, and while we can find out whether a user has scrolled through listening to the document's scroll in a useEffect hook, we cannot close the Listbox itself through this function. We think it would benefit developers to allow for this behavior.
Beta Was this translation helpful? Give feedback.
All reactions