Created
June 10, 2025 04:32
-
-
Save xantiagoma/a618f3024e91e15d4719309d6e22b055 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
useHotkeys('p', () => { | |
selectPositionRef.current?.focus(); | |
setTimeout(() => { | |
// Create an 'ArrowDown' key event to open the dropdown | |
const openEvent = new KeyboardEvent('keydown', { | |
key: 'ArrowDown', | |
code: 'ArrowDown', | |
bubbles: true, | |
cancelable: true, | |
}); | |
selectPositionRef.current?.dispatchEvent(openEvent); | |
}, 0); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment