mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 16:05:58 +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 { Select, Spin, Tag, Tooltip } from 'antd';
|
||||||
import { OPERATORS } from 'constants/queryBuilder';
|
import { OPERATORS } from 'constants/queryBuilder';
|
||||||
import { LogsExplorerShortcuts } from 'constants/shortcuts/logsExplorerShortcuts';
|
|
||||||
import { getDataTypes } from 'container/LogDetailedView/utils';
|
import { getDataTypes } from 'container/LogDetailedView/utils';
|
||||||
import { useKeyboardHotkeys } from 'hooks/hotkeys/useKeyboardHotkeys';
|
|
||||||
import {
|
import {
|
||||||
useAutoComplete,
|
useAutoComplete,
|
||||||
WhereClauseConfig,
|
WhereClauseConfig,
|
||||||
@ -77,8 +75,6 @@ function QueryBuilderSearch({
|
|||||||
searchKey,
|
searchKey,
|
||||||
);
|
);
|
||||||
|
|
||||||
const { registerShortcut, deregisterShortcut } = useKeyboardHotkeys();
|
|
||||||
|
|
||||||
const { handleRunQuery } = useQueryBuilder();
|
const { handleRunQuery } = useQueryBuilder();
|
||||||
|
|
||||||
const onTagRender = ({
|
const onTagRender = ({
|
||||||
@ -204,18 +200,6 @@ function QueryBuilderSearch({
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
}, [sourceKeys]);
|
}, [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 (
|
return (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user