Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] keyCode in keydown event #141

Closed
raminjafary opened this issue Jan 31, 2021 · 1 comment
Closed

[Enhancement] keyCode in keydown event #141

raminjafary opened this issue Jan 31, 2021 · 1 comment

Comments

@raminjafary
Copy link

I think it is better to set the keyCode in keydown to 27 so one can close it with Escape key as it is more of a convention. This is what it looks like right now:

mounted () {

  /* --- snip --- */

document.body.addEventListener('keydown', e => {
      e = e || event
      if (e.keyCode === 9 && this.visible) this.visible = false
    })
}

As an enhancement we can make this a configurable option. I may open a PR, of course, if you do concur.

@talkhabi
Copy link
Owner

Thank you @raminjafary Ill add the 27 too, 9 is for tab key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants