🐛 (buttons) Fix dynamic buttons edge not showing

This commit is contained in:
Baptiste Arnaud
2023-02-23 19:22:32 +01:00
parent 0619c60970
commit e1b7320f6f
4 changed files with 13 additions and 16 deletions

View File

@@ -25,7 +25,9 @@ import { useParentModal } from '@/features/graph/providers/ParentModalProvider'
type Props = {
initialVariableId?: string
autoFocus?: boolean
onSelectVariable: (variable: Pick<Variable, 'id' | 'name'>) => void
onSelectVariable: (
variable: Pick<Variable, 'id' | 'name'> | undefined
) => void
} & InputProps
export const VariableSearchInput = ({
@@ -68,6 +70,9 @@ export const VariableSearchInput = ({
const onInputChange = (e: ChangeEvent<HTMLInputElement>) => {
setInputValue(e.target.value)
if (e.target.value === '') {
if (inputValue.length > 0) {
onSelectVariable(undefined)
}
setFilteredItems([...variables.slice(0, 50)])
return
}