Fix #1128: Lock focus in modals to improve accessibility

This commit is contained in:
Agate 2020-07-03 16:07:44 +02:00
parent c5755e21a5
commit 0094cbb7d1
11 changed files with 40 additions and 13 deletions

View file

@ -209,7 +209,7 @@ import $ from 'jquery'
import moment from "moment"
import lodash from '@/lodash'
import time from "@/utils/time"
import createFocusTrap from 'focus-trap'
import store from "@/store"
export default {
@ -224,11 +224,14 @@ export default {
showVolume: false,
isShuffling: false,
tracksChangeBuffer: null,
focusTrap: null,
time
}
},
mounted () {
let self = this
this.focusTrap = createFocusTrap(this.$el, {allowOutsideClick: () => { return true }})
this.focusTrap.activate()
this.$nextTick(() => {
setTimeout(() => {
this.scrollToCurrent()