Skip to content

Commit

Permalink
Issue 555: Made the x-trap directive on the drawer optional with a de…
Browse files Browse the repository at this point in the history
…fault the same as current behavior. (robsontenorio#556)
  • Loading branch information
TobiasLounsbury authored Aug 7, 2024
1 parent 5b641d6 commit a62c4d1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/View/Components/Drawer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public function __construct(
public ?bool $separator = false,
public ?bool $withCloseButton = false,
public ?bool $closeOnEscape = false,
public ?bool $withoutTrapFocus = false,

//Slots
public ?string $actions = null
Expand Down Expand Up @@ -58,7 +59,10 @@ public function render(): View|Closure|string
@keydown.window.escape="close()"
@endif
x-trap="open" x-bind:inert="!open"
@if(!$withoutTrapFocus)
x-trap="open" x-bind:inert="!open"
@endif
@class(["drawer absolute z-50", "drawer-end" => $right])
>
<!-- Toggle visibility -->
Expand Down

0 comments on commit a62c4d1

Please sign in to comment.