Skip to content

Commit

Permalink
Fix keyboard shortcut bindings (#2873)
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurperton authored Nov 24, 2020
1 parent f7d242e commit 9f562ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
9 changes: 2 additions & 7 deletions resources/js/components/assets/Folder/Folder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,8 @@ export default {
},
created() {
// Allow key commands with a focused input
this.$keys.stop(e => {
return ! ['enter', 'escape'].includes(e.code.toLowerCase())
})
this.$keys.bind('enter', this.submit)
this.$keys.bind('esc', this.cancel)
this.$keys.bindGlobal('enter', this.submit)
this.$keys.bindGlobal('esc', this.cancel)
},
}
Expand Down
7 changes: 1 addition & 6 deletions resources/js/components/structures/PageEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,7 @@ export default {
},
created() {
// Allow key commands with a focused input
this.$keys.stop(e => {
return ! ['enter'].includes(e.code.toLowerCase())
})
this.$keys.bind('enter', this.submit)
this.$keys.bindGlobal('enter', this.submit)
},
}
Expand Down

0 comments on commit 9f562ef

Please sign in to comment.