Skip to content

Commit

Permalink
Pass the sidebar as additional focus trap element
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliushaertl authored and skjnldsv committed Aug 18, 2022
1 parent b8e7cdc commit 7e61528
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 77 deletions.
4 changes: 2 additions & 2 deletions js/viewer-main.js

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions js/viewer-main.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ object-assign
* Released under the MIT License.
*/

/*!
* focus-trap 6.9.4
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
*/

/*!
* tabbable 5.3.3
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
*/

/*! For license information please see ActionButton.js.LICENSE.txt */

/*! For license information please see ActionLink.js.LICENSE.txt */
Expand Down
2 changes: 1 addition & 1 deletion js/viewer-main.js.map

Large diffs are not rendered by default.

98 changes: 24 additions & 74 deletions package-lock.json

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

5 changes: 5 additions & 0 deletions src/views/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
:data-handler="handlerId"
@close="close"
@previous="previous"
:additional-trap-elements="trapElements"
@next="next">
<!-- ACTIONS -->
<template #actions>
Expand Down Expand Up @@ -203,6 +204,8 @@ export default {
theme: null,
root: getRootPath(),
handlerId: '',
trapElements: [],
}
},
Expand Down Expand Up @@ -805,11 +808,13 @@ export default {
const sidebar = document.querySelector('aside.app-sidebar')
if (sidebar) {
this.sidebarWidth = sidebar.offsetWidth
this.trapElements = [sidebar]
}
},
handleAppSidebarClose() {
this.isSidebarShown = false
this.trapElements = []
},
onResize(event) {
Expand Down

0 comments on commit 7e61528

Please sign in to comment.