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

[DOCS]: PopoverPanel modal incorrectly says default=true and makes others inert #3223

Closed
david-crespo opened this issue May 21, 2024 · 2 comments

Comments

@david-crespo
Copy link

This bit of the docs appears to be incorrect.

https://headlessui.com/react/popover

image

Based on the description of #3124 both of the following are intentional, so the fix would be to the docs rather than the code.

modal defaults to false

PopoverPanel does not call useOthersInert

// Ensure we close the popover as soon as the button becomes hidden
useOnDisappear(state.button, () => dispatch({ type: ActionTypes.ClosePopover }), visible)
// Enable scroll locking when the popover is visible, and `modal` is enabled
useScrollLock(ownerDocument, state.__demoMode ? false : modal && visible)

@RobinMalfait
Copy link
Collaborator

Good catch!

You are right that the Popover component doesn't set the inert attribute on other elements. We've updated the docs accordingly. Thanks

@david-crespo
Copy link
Author

david-crespo commented May 25, 2024

Thanks! I don’t want to be pedantic, but it still says modal defaults to true and I don’t think it does.

Fixed now too.

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

No branches or pull requests

2 participants