Seeking Input: useHotkeys Event Propagation Challenge #1271
Unanswered
svelpari-nagarro
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Parent and child components both use the same shortcut (e.g., meta+backspace). I want both of these events to get trigerred.
With native
onKeyDown
events, React's event delegation ensures both handlers fire (bubbling phase)With
useHotkeys
, complex parent operations (like modal launches) can interrupt propagation, The event loop gets occupied before child handlers execute. I am handling it temporarily by wrapping the complex operations with setTimeOut. Has anyone found a more elegant solution for this?Beta Was this translation helpful? Give feedback.
All reactions