mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-13 19:35:56 +08:00
fix: shortcuts break when there are multiple queries (#4532)
This commit is contained in:
parent
6bc5ceac3e
commit
02f83e4b4a
@ -2,9 +2,7 @@ import './QueryBuilderSearch.styles.scss';
|
||||
|
||||
import { Select, Spin, Tag, Tooltip } from 'antd';
|
||||
import { OPERATORS } from 'constants/queryBuilder';
|
||||
import { LogsExplorerShortcuts } from 'constants/shortcuts/logsExplorerShortcuts';
|
||||
import { getDataTypes } from 'container/LogDetailedView/utils';
|
||||
import { useKeyboardHotkeys } from 'hooks/hotkeys/useKeyboardHotkeys';
|
||||
import {
|
||||
useAutoComplete,
|
||||
WhereClauseConfig,
|
||||
@ -77,8 +75,6 @@ function QueryBuilderSearch({
|
||||
searchKey,
|
||||
);
|
||||
|
||||
const { registerShortcut, deregisterShortcut } = useKeyboardHotkeys();
|
||||
|
||||
const { handleRunQuery } = useQueryBuilder();
|
||||
|
||||
const onTagRender = ({
|
||||
@ -204,18 +200,6 @@ function QueryBuilderSearch({
|
||||
/* eslint-disable react-hooks/exhaustive-deps */
|
||||
}, [sourceKeys]);
|
||||
|
||||
useEffect(() => {
|
||||
registerShortcut(LogsExplorerShortcuts.FocusTheSearchBar, () => {
|
||||
// set timeout is needed here else the select treats the hotkey as input value
|
||||
setTimeout(() => {
|
||||
selectRef.current?.focus();
|
||||
}, 0);
|
||||
});
|
||||
|
||||
return (): void =>
|
||||
deregisterShortcut(LogsExplorerShortcuts.FocusTheSearchBar);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
|
Loading…
x
Reference in New Issue
Block a user