You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when I set a container to the dialog portal component, the pointer-events:none will still be added to body. But not to the container that I set?
In my case, the modal dialog should avoid the pointer events only for the container I set. For the others, such as footer, which is outside the specific container, shouldn't be avoid.
If modal is specific to a container, can we also specific the pointer events to the container too?
Additional context
Your environment
Software
Name(s)
Version
Radix Package(s)
React
n/a
Browser
Assistive tech
Node
n/a
npm/yarn
Operating System
The text was updated successfully, but these errors were encountered:
Hazel0913
changed the title
Dialog, Portal container. pointer-events:none will still add to body event I set a container to the dialog portal
Dialog, Portal container. pointer-events:none will still add to <body> even I set a container to the dialog portal
Feb 3, 2022
Hazel0913
changed the title
Dialog, Portal container. pointer-events:none will still add to <body> even I set a container to the dialog portal
Dialog, Portal container: pointer-events:none will still add to <body> even I set a container to the dialog portal
Feb 3, 2022
The container prop is purely for more control over positioning/styling.
Unfortunately, your suggestion would be incorrect in terms of accessibility as far as I can tell:
A dialog is a window overlaid on either the primary window or another dialog window. Windows under a modal dialog are inert. That is, users cannot interact with content outside an active dialog window. https://www.w3.org/TR/wai-aria-practices/#dialog_modal
Note the mention of "primary window" here and how all windows underneath should be inert when modal. The primary window is the body element:
A dialog is a descendant window of the primary window of a web application. For HTML pages, the primary application window is the entire web document, i.e., the body element. https://www.w3.org/TR/wai-aria-1.2/#dialog
If you wish to interact with elements outside of your dialog you can set modal={false} on the Dialog.Root.
Bug report
Current Behavior
Currently, when I set a container to the dialog portal component, the pointer-events:none will still be added to body. But not to the container that I set?
In my case, the modal dialog should avoid the pointer events only for the container I set. For the others, such as footer, which is outside the specific container, shouldn't be avoid.
Expected behavior
Add pointer-events:none to the container of the portal.
Reproducible example
https://codesandbox.io/s/new-cherry-2w6dw?file=/src/App.tsx
Suggested solution
If modal is specific to a container, can we also specific the pointer events to the container too?
Additional context
Your environment
The text was updated successfully, but these errors were encountered: