1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-27 06:01:54 +03:00

Improved header element accessibility when at mobile sizes

Intended to fix issues raised in #2681.
Changes up the tri-layout tabs, and the main header menu toggle,
to be buttons while adding better text and keyboard controls.

Updated the component format of a few elements along the way.
This commit is contained in:
Dan Brown
2021-04-19 21:41:13 +01:00
parent 60ffe6a993
commit 9df4dee1b2
8 changed files with 66 additions and 31 deletions

View File

@ -12,6 +12,7 @@ class DropDown {
this.menu = this.$refs.menu;
this.toggle = this.$refs.toggle;
this.moveMenu = this.$opts.moveMenu;
this.bubbleEscapes = this.$opts.bubbleEscapes === 'true';
this.direction = (document.dir === 'rtl') ? 'right' : 'left';
this.body = document.body;
@ -137,7 +138,9 @@ class DropDown {
} else if (event.key === 'Escape') {
this.hide();
this.toggle.focus();
event.stopPropagation();
if (!this.bubbleEscapes) {
event.stopPropagation();
}
}
};
this.container.addEventListener('keydown', keyboardNavigation);