Skip to content

Commit 7e61528

Browse files
juliusknorrskjnldsv
authored andcommitted
Pass the sidebar as additional focus trap element
Signed-off-by: Julius Härtl <jus@bitgrid.net>
1 parent b8e7cdc commit 7e61528

5 files changed

Lines changed: 42 additions & 77 deletions

File tree

js/viewer-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/viewer-main.js.LICENSE.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ object-assign
3131
* Released under the MIT License.
3232
*/
3333

34+
/*!
35+
* focus-trap 6.9.4
36+
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
37+
*/
38+
39+
/*!
40+
* tabbable 5.3.3
41+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
42+
*/
43+
3444
/*! For license information please see ActionButton.js.LICENSE.txt */
3545

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

js/viewer-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 24 additions & 74 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/views/Viewer.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
:data-handler="handlerId"
4343
@close="close"
4444
@previous="previous"
45+
:additional-trap-elements="trapElements"
4546
@next="next">
4647
<!-- ACTIONS -->
4748
<template #actions>
@@ -203,6 +204,8 @@ export default {
203204
theme: null,
204205
root: getRootPath(),
205206
handlerId: '',
207+
208+
trapElements: [],
206209
}
207210
},
208211
@@ -805,11 +808,13 @@ export default {
805808
const sidebar = document.querySelector('aside.app-sidebar')
806809
if (sidebar) {
807810
this.sidebarWidth = sidebar.offsetWidth
811+
this.trapElements = [sidebar]
808812
}
809813
},
810814
811815
handleAppSidebarClose() {
812816
this.isSidebarShown = false
817+
this.trapElements = []
813818
},
814819
815820
onResize(event) {

0 commit comments

Comments
 (0)