🐛 Refresh variable list on focus

This commit is contained in:
Baptiste Arnaud
2023-04-19 16:41:35 +02:00
parent fc561430a0
commit b614544909
5 changed files with 32 additions and 25 deletions

View File

@@ -162,6 +162,11 @@ export const VariableSearchInput = ({
return setKeyboardFocusIndex(undefined)
}
const openDropdown = () => {
if (inputValue === '') setFilteredItems(variables)
onOpen()
}
return (
<Flex ref={dropdownRef} w="full">
<Popover
@@ -177,7 +182,7 @@ export const VariableSearchInput = ({
ref={inputRef}
value={inputValue}
onChange={onInputChange}
onFocus={onOpen}
onFocus={openDropdown}
onKeyDown={handleKeyUp}
placeholder={inputProps.placeholder ?? 'Select a variable'}
autoComplete="off"