Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion redisinsight/ui/src/components/query/Query/Query.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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 || ''
Expand Down