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 8767df3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/assets/stylesheets/media.scss
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,9 @@
flex-grow: 0;
flex-shrink: 0;
flex-basis: 0;

&.open {
transition: flex-basis .5s ease-in-out;
flex-basis: var(--drawer-width);
}
}
Expand Down
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 8767df3

Please sign in to comment.