-
Notifications
You must be signed in to change notification settings - Fork 231
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
How to handle key events when I have global listeners? #297
Comments
Try with removing the event handlers for key events from the slider component. Instead, add a global event listener that listens for key events regardless of focus. In the event handler for the key events, check if the slider has focus. If it does, control the animation accordingly. This way, you can have consistent control over the animation whether the slider has focus or not. |
Thanks! 🙏 In my case it seems like removing the event handlers for the keys. Will start there. |
Thanks for providing this component!
I want to control an animation with the slider. So I have only one slider. I want the same things to happen when I press keys like
right
orleft
when the slider has focus as when it doesn't have focus. Currently I can control the animation with keys. The slider also has event handlers for the keys, and as I want to control the animation from the slider, it gets to be a double command that I don't know how to deal with. Anyone has some pointers for me?Possibly related:
The text was updated successfully, but these errors were encountered: