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

Support multiple keystroke binds for KeyboardEvent Filter #776

Open
omarluq opened this issue Jun 27, 2024 · 0 comments
Open

Support multiple keystroke binds for KeyboardEvent Filter #776

omarluq opened this issue Jun 27, 2024 · 0 comments

Comments

@omarluq
Copy link

omarluq commented Jun 27, 2024

Hello,

I'm aware that there was a previous conversation around multi-event actions support which was rejected, but I think there is a strong argument to be made for multiple keystrokes support with KeyboardEvent Filter. More often than not, you have multiple keys that need to trigger the same action.

Currently

<button
  data-controller='my-controller' 
  data-action='keydown.delete->my-controller#my-action:prevent 
               keydown.backspace->my-controller#my-action:prevent' />

proposed

<button
  data-controller='my-controller' 
  data-action='keydown.(delete, backspace)->my-controller#my-action:prevent />

I believe this change would significantly improve developer experience when working with keyboard events in Stimulus.

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

No branches or pull requests

1 participant