Last active
August 4, 2020 23:57
-
-
Save skflowne/8760587ffb447126f44b37e23f7fb023 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
| const handleKeyDown = (e: KeyboardEvent) => { | |
| if (e.key === "ArrowDown") { | |
| fileIndex.update((i) => (i + 1) % $fileSearchResults.length) | |
| } | |
| if (e.key === "ArrowUp") { | |
| fileIndex.update((i) => (i - 1 < 0 ? $fileSearchResults.length - 1 : i - 1)) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment