diff --git a/redisinsight/ui/src/components/query/Query/Query.tsx b/redisinsight/ui/src/components/query/Query/Query.tsx index e696c82a14..c5c8e76092 100644 --- a/redisinsight/ui/src/components/query/Query/Query.tsx +++ b/redisinsight/ui/src/components/query/Query/Query.tsx @@ -95,6 +95,11 @@ const Query = (props: Props) => { const onChange = (value: string = '') => { setQuery(value) + + // clear history position after scrolling all list with empty value + if (value === '' && execHistoryPos >= execHistory.length) { + execHistoryPos = 0 + } } const handleKeyDown = (e: React.KeyboardEvent) => { @@ -127,7 +132,8 @@ const Query = (props: Props) => { const { editor } = monacoObjects?.current const position = editor.getPosition() - if (position?.lineNumber !== 1) return + // @ts-ignore + if (position?.lineNumber !== 1 || editor.getContribution('editor.contrib.suggestController')?.model?.state) return if (execHistory[execHistoryPos]) { const command = execHistory[execHistoryPos].command || ''