tailwindlabs / headlessui

Completely unstyled, fully accessible UI components, designed to integrate beautifully with Tailwind CSS.
https://headlessui.com
MIT License
25.81k stars 1.07k forks source link

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

Closed david-crespo closed 4 months ago

david-crespo commented 4 months ago

This bit of the docs appears to be incorrect.

https://headlessui.com/react/popover

image

Based on the description of https://github.com/tailwindlabs/headlessui/pull/3124 both of the following are intentional, so the fix would be to the docs rather than the code.

modal defaults to false

https://github.com/tailwindlabs/headlessui/blob/045f2bc761be3d30ef203ccb3da2c0292c8a5397/packages/%40headlessui-react/src/components/popover/popover.tsx#L815

PopoverPanel does not call useOthersInert

https://github.com/tailwindlabs/headlessui/blob/045f2bc761be3d30ef203ccb3da2c0292c8a5397/packages/%40headlessui-react/src/components/popover/popover.tsx#L857-L861

RobinMalfait commented 4 months ago

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 commented 4 months ago

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.