robsontenorio / mary

Laravel Blade UI Components for Livewire 3
https://mary-ui.com
Other
1.04k stars 125 forks source link

Drawer use of x-trap directive renders the rest of the page unfocusable #555

Closed TobiasLounsbury closed 2 months ago

TobiasLounsbury commented 2 months ago

maryUI version

1.34.2

daisyUI version

4.5.0

Livewire version

3.4.6

What browsers are affected?

Firefox, Chrome, Safari, Microsoft Edge

What happened?

Use of the x-trap alpine directive makes it impossible to use the drawer along with other elements on the page at the same time. In the normal course of a menu that navigates away this is fine, but in my specific use case, I need to be able to trigger a modal that lives elsewhere on the page and the trap directive causes the modal to be un-focusable. My suggested fix is to make an optional flag to selectively not apply the trap directive. Defaulting to the same behavior as currently would not affect future upgrades but should make it simple enough to remove the directive when needed for projects that need to.

TobiasLounsbury commented 2 months ago

If this is accepted I can also do a PR against the website repo to update the documentation as well.