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

Implement esc-close when text input in focus #1038

Open
jacobg opened this issue Nov 7, 2024 · 1 comment
Open

Implement esc-close when text input in focus #1038

jacobg opened this issue Nov 7, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@jacobg
Copy link

jacobg commented Nov 7, 2024

Is your feature request related to a problem? Please describe.
Currently the esc-close option only works when the menu is in focus. If the text input is in focus, then esc-close doesn't do anything.

Describe the solution you'd like
Please close menu when the esc key is pressed while text input in focus.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@jacobg jacobg added awaiting triage The issue is not reviewed by the maintainers enhancement New feature or request labels Nov 7, 2024
@jacobg
Copy link
Author

jacobg commented Nov 7, 2024

Workaround:

onMounted(() => {
  const inputEl = picker.value.$el.querySelector('.dp__input')
  // https://github.com/Vuepic/vue-datepicker/issues/1038
  inputEl.addEventListener('keydown', event => {
    if (event.key === 'Escape') {
      picker.value.closeMenu()
    }
  })
})

@Jasenkoo Jasenkoo removed the awaiting triage The issue is not reviewed by the maintainers label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants