mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-27 18:40:31 +00:00
same but for js
This commit is contained in:
parent
b15e0e37fc
commit
89713ce685
1 changed files with 3 additions and 0 deletions
|
@ -507,8 +507,10 @@ let BookWyrm = new class {
|
|||
menuElement.querySelectorAll(
|
||||
'a[href]:not([disabled]), button:not([disabled])'
|
||||
)[0].focus();
|
||||
|
||||
// Enable focus trap
|
||||
menuElement.addEventListener('keydown', this.handleFocusTrap);
|
||||
|
||||
// Close on Esc
|
||||
detailsElement.addEventListener('keydown', handleEscKey);
|
||||
|
||||
|
@ -518,6 +520,7 @@ let BookWyrm = new class {
|
|||
}
|
||||
} else {
|
||||
summaryElement.focus();
|
||||
|
||||
// Disable focus trap
|
||||
menuElement.removeEventListener('keydown', this.handleFocusTrap);
|
||||
|
||||
|
|
Loading…
Reference in a new issue