-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Dialog does not mark other elements inert #2289
Comments
Hey! Thank you for your bug report! You are correct, we had a logical error that made it stop working. We also have some other rules that apply so I updated the logic to support. Some history: Some months later, it turned out that some users had issue with 3rd party libraries not working properly with the Rendering items as a sibling meant that an "outside click" would now be triggered the moment you interact with the Dialog. To solve this we introduced the concept of "allowed containers". This is an assumption, but currently we allow all elements rendered directly in the Now we have to be careful here, because solving the initial "mark others as The solution that is implemented now will only mark the main application root as Additionally, if you are using nested Here you can see the main app root node ( That all being said. You probably won't see this being fixed on the Headless UI documentation itself. This is because we are actually cheating on those docs. We have a demo mode for the docs. The main reason for this is that we want to showcase each component being styled at the top of the page. This means that the
Hope this makes sense! This should be fixed by #2290, and will be available in the next release. You can already try it using:
|
Thank you for your work and detailed description of the problem. 🙏 |
Not 100%; For example when the Dialog opens the focus is moved into the Dialog. This means that if you click a link that goes to a specific heading in the documentation, then the Dialog would "steal" focus and the page would scroll up. |
Oh, interesting! Thank you for clarifying it! |
What package within Headless UI are you using?
@headlessui/vue
What version of that package are you using?
For example: v1.7.10
What browser are you using?
Chrome
Reproduction URL
https://headlessui.com/examples/vue-dialog-hero
https://headlessui.com/examples/react-dialog-hero
Describe your issue
The documentation says:
I checked the code and if I understand it well,
useInertOthers
should mark the other elements in they body withinert
andaria-hidden
, but it does not happen.Maybe I'm misunderstanding something, but I expected everything besides
headlessui-portal-root
to be marked. I experience the same in my project, but both the official vue and react examples behave the same.The text was updated successfully, but these errors were encountered: