Skip to content

Commit

Permalink
Merge pull request #4677 from nextcloud-libraries/bugfix/noid/escape-…
Browse files Browse the repository at this point in the history
…modal-multiple

fix: Avoid closing all modals on escape if multiple are present
  • Loading branch information
susnux authored Oct 20, 2023
2 parents 9a55a95 + a0994ef commit 32c7d04
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/NcModal/NcModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,11 @@ export default {
*/
handleKeydown(event) {
if (event.key === 'Escape') {
const trapStack = getTrapStack()
// Only close the most recent focus trap modal
if (trapStack.length > 0 && trapStack[trapStack.length - 1] !== this.focusTrap) {
return
}
return this.close(event)
}

Expand Down

0 comments on commit 32c7d04

Please sign in to comment.