Skip to content

Commit

Permalink
fix(frontend/modal): trap focus (#576)
Browse files Browse the repository at this point in the history
  • Loading branch information
c0rydoras authored Jan 14, 2025
1 parent 3b3629a commit 5faa9b1
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 7 deletions.
6 changes: 5 additions & 1 deletion frontend/app/components/modal.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{{#if @visible}}
{{#in-element this.target insertBefore=null}}
<Modal::Overlay @visible={{@visible}} @onClose={{optional @onClose}}>
<Modal::Overlay
@visible={{@visible}}
@onClose={{optional @onClose}}
{{focus-trap}}
>
<div
class="modal-dialog bg-background z-50 max-h-[100%] w-full rounded border"
...attributes
Expand Down
1 change: 1 addition & 0 deletions frontend/app/components/modal/overlay.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
id={{this.id}}
{{! template-lint-disable no-invalid-interactive }}
{{on "click" this.handleClick}}
...attributes
>
{{yield}}
</div>
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"ember-decorators": "6.1.1",
"ember-event-helpers": "^0.1.1",
"ember-fetch": "8.1.2",
"ember-focus-trap": "^1.1.1",
"ember-in-viewport": "4.1.0",
"ember-keyboard": "^9.0.1",
"ember-load-initializers": "2.1.2",
Expand Down
41 changes: 35 additions & 6 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5faa9b1

Please sign in to comment.