Skip to content

Commit

Permalink
fix: added keyCode for keydown event
Browse files Browse the repository at this point in the history
  • Loading branch information
kouts committed Apr 18, 2022
1 parent e62af8d commit 084ec52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ export default {
}
},
keydown(e) {
if (e.which === 27) {
if (e.which === 27 || e.keyCode === 27) {
this.close()
}
if (e.which === 9) {
if (e.which === 9 || e.keyCode === 9) {
// Get only visible elements
const all = [].slice.call(this.$refs['vm-wrapper'].querySelectorAll(FOCUSABLE_ELEMENTS)).filter(function (el) {
return !!(el.offsetWidth || el.offsetHeight || el.getClientRects().length)
Expand Down

0 comments on commit 084ec52

Please # to comment.