Skip to content

Commit

Permalink
fix(NcModal): ignore arrow navigation active element is outside
Browse files Browse the repository at this point in the history
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
  • Loading branch information
ShGKme committed Aug 9, 2023
1 parent 6b14f10 commit ca40299
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/components/NcModal/NcModal.vue
Expand Up @@ -618,6 +618,15 @@ export default {
// Key Handlers
handleKeydown(e) {
// Ignore arrow navigation, if there is a current focus outside the modal.
// For example, when the focus is in Sidebar or NcActions's items,
// arrow navigation should not be intercept by modal slider
if (document.activeElement) {
if (!this.$el.contains(document.activeElement)) {
return
}
}
switch (e.keyCode) {
case 37: // left arrow
this.previous(e)
Expand Down

0 comments on commit ca40299

Please sign in to comment.