From 64a3b0dc45c7708696628ddc8249c02c1117d2cf Mon Sep 17 00:00:00 2001 From: Linus Pahl Date: Mon, 5 Feb 2024 17:00:22 +0100 Subject: [PATCH] Disable query input keyboard shortcuts outside of query input. (#18160) --- .../views/components/searchbar/queryinput/QueryInput.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/graylog2-web-interface/src/views/components/searchbar/queryinput/QueryInput.tsx b/graylog2-web-interface/src/views/components/searchbar/queryinput/QueryInput.tsx index 49fef91a5e93..8021e49b32a0 100644 --- a/graylog2-web-interface/src/views/components/searchbar/queryinput/QueryInput.tsx +++ b/graylog2-web-interface/src/views/components/searchbar/queryinput/QueryInput.tsx @@ -184,29 +184,36 @@ const useCompleter = ({ streams, timeRange, completerFactory, view }: Pick { + const options = { enabled: false }; + useHotkey({ scope: 'query-input', actionKey: 'submit-search', + options, }); useHotkey({ scope: 'query-input', actionKey: 'insert-newline', + options, }); useHotkey({ scope: 'query-input', actionKey: 'create-search-filter', + options, }); useHotkey({ scope: 'query-input', actionKey: 'show-suggestions', + options, }); useHotkey({ scope: 'query-input', actionKey: 'show-history', + options, }); }; @@ -282,8 +289,6 @@ const QueryInput = React.forwardRef(({ name: 'Show completions', bindKey: { win: 'Alt-Space', mac: 'Alt-Space' }, exec: async (editor: Editor) => { - console.log('test', editor.getValue()); - if (editor.getValue()) { startAutocomplete(editor);