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

Fix ListboxOptions being incorrectly marked as inert #3466

Merged
merged 2 commits into from
Sep 9, 2024

Conversation

RobinMalfait
Copy link
Member

@RobinMalfait RobinMalfait commented Sep 9, 2024

This PR fixes an issue where the ListboxOptions component was incorrectly marked as inert.

We only mark the other elements on the page as inert once the Listbox is in a visible state. The issue is that the data.optionsElement (a reference to the DOM node) was not populated with the actual DOM node yet at the time the useInertOthers(…) hook was applied.

Due to the usage of useEvent(…), instead of useCallback(…) the internal useEffect(…) hook didn't re-run because the allowed function was already stable.

With this fix, the allowed function will change whenever its dependencies change.

Fixes: #3464

Copy link

vercel bot commented Sep 9, 2024

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

Name Status Preview Comments Updated (UTC)
headlessui-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 9, 2024 4:41pm
headlessui-vue ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 9, 2024 4:41pm

@RobinMalfait RobinMalfait merged commit 07c9f1f into main Sep 9, 2024
8 checks passed
@RobinMalfait RobinMalfait deleted the fix/issue-3464 branch September 9, 2024 19:09
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.1.3 breaks listbox when ListboxOptions is used without anchor
1 participant