emilkowalski / vaul

A drawer component for React.
https://vaul.emilkowal.ski
MIT License
6.45k stars 215 forks source link

Input elements outside drawer are not interactable, even with "modal" set to false, since 0.9.4 #496

Open tylerlaberge opened 3 weeks ago

tylerlaberge commented 3 weeks ago

On the latest version of this library I am unable to interact with input elements that are located outside of the drawer component, even with the "model" prop set to false.

I've done some digging and discovered what is causing the issue

In 0.9.4 an MR was merged in that removed the "modal" prop from the DialogPrimitive.Root component (see line 621 in this MR https://github.com/emilkowalski/vaul/pull/424/files)

From the radix-ui documentation for this "modal" prop

"The modality of the dialog. When set to true, interaction with outside elements will be disabled and only dialog content will be visible to screen readers."

The prop defaults to true, so by omitting it the dialog component will be disabling interaction with outside elements.

When the "modal" prop was first added it was correctly being passed along to the Dialog Root component (see line 512 in https://github.com/emilkowalski/vaul/pull/69/files and the related issue https://github.com/emilkowalski/vaul/issues/37)

I did some testing and manually hard coding the Dialog Root component to set modal={false} fixes the issue, also downgrading to 0.9.3 fixes the issue as well.

alexdemers commented 2 weeks ago

See https://github.com/emilkowalski/vaul/issues/497#issuecomment-2452503724