From c098ff33236ec11155e94bbcf7f0fecfad975fc5 Mon Sep 17 00:00:00 2001 From: leon-up9 <97597983+leon-up9@users.noreply.github.com> Date: Wed, 26 Jan 2022 15:35:13 +0200 Subject: [PATCH] TRA-4169 apply query by enter (#665) --- ui/src/hooks/useKeyPress.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/src/hooks/useKeyPress.ts b/ui/src/hooks/useKeyPress.ts index 4f14fd2c7..ffc6e7f07 100644 --- a/ui/src/hooks/useKeyPress.ts +++ b/ui/src/hooks/useKeyPress.ts @@ -10,6 +10,8 @@ const useKeyPress = (eventConfigs, callback, node = null) => { // handle what happens on key press const handleKeyPress = useCallback( (event) => { + event.preventDefault(); + // check if one of the key is part of the ones we want if (eventConfigs.some((eventConfig) => Object.keys(eventConfig).every(nameKey => eventConfig[nameKey] === event[nameKey]))) { callbackRef.current(event);