-
Couldn't load subscription status.
- Fork 1k
Closed
Labels
Resolution: Solution ProvidedAn existing solution to the issue was providedAn existing solution to the issue was provided
Description
Bug report
Current Behavior
Working with animation on libraries like Framer Motion the docs suggest to use the forceMount flag. The Dialog component seems to have a few issues with this:
pointer-events: noneis applied to bothdocument.bodyandoverlaywhenforceMountis enabled. This prevents any interaction with the actual application (even initially opening the dialog). It does not care about the actual value of theopenproperty passed with theRootcomponent.- Setting
modal=falseonRootfixes these twopointer-eventrelated issues but messes with the overlay component. It never mounts the overlay... never. Not even whenforceMountis true.
Expected behavior
pointer-eventshould only be applied when the dialog is open ... independent from the actual mount scenario relying on the open state/prop.modal: falseshould still mount the overlay whenforceMountistrue.
Reproducible example
Suggested solution
I have not checked the code in detail but I guess with a small number of tweaks in the logic it should be done... Hopefully not breaking other expected behavior. I also would suggest to add a full blown working demo using an animation library like framer-motion to the docs.
Additional context
Your environment
| Software | Name(s) | Version |
|---|---|---|
| Radix Package(s) | @radix-ui/react-dialog | 1.0.3 |
| React | n/a | 18.2.0 |
| Browser | Chrome | 110 |
| Assistive tech | - | - |
| Node | n/a | 16.19.1 |
| npm/yarn | pnpm | 7.29.0 |
| Operating System |
Metadata
Metadata
Assignees
Labels
Resolution: Solution ProvidedAn existing solution to the issue was providedAn existing solution to the issue was provided