Skip to content

Commit

Permalink
When drawer is closed, remove it from the accessabilty tree
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Nov 10, 2023
1 parent 0bacb29 commit 5691ace
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/javascript/src/controllers/media_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@ export default class extends Controller {
}

toggleLeft() {
this.leftDrawerTarget.classList.toggle('open')
const classList = this.leftDrawerTarget.classList
if (classList.contains('open')) {
classList.remove('open')
setTimeout(() => {
this.leftDrawerTarget.style.visibility = 'hidden' // remove from accessability tree
}, 1000)
} else {
this.leftDrawerTarget.style.visibility = ''
classList.add('open')
}
}

openModalComponentsPopover() {
Expand Down

0 comments on commit 5691ace

Please sign in to comment.