Skip to content

Commit 9c2aa1e

Browse files
authored
filter keys in the beginning of useJump (#358)
1 parent dcb0d17 commit 9c2aa1e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

ui/src/components/Canvas.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,17 @@ function useJump() {
361361

362362
const selectedPods = useStore(store, (state) => state.selectedPods);
363363
const handleKeyDown = (event) => {
364+
// Only handle the arrow keys.
365+
switch (event.key) {
366+
case "ArrowUp":
367+
case "ArrowDown":
368+
case "ArrowLeft":
369+
case "ArrowRight":
370+
break;
371+
default:
372+
return;
373+
}
374+
// Get the selected node.
364375
const id = selectedPods.values().next().value; // Assuming only one node can be selected at a time
365376
if (!id) {
366377
console.log("No node selected");

0 commit comments

Comments
 (0)