2
0

fix(editor): 🐛 FIx Webhook settings debounce

This commit is contained in:
Baptiste Arnaud
2022-03-10 17:32:14 +01:00
parent 6cf89d8d9c
commit 31298e39c1
11 changed files with 50 additions and 15 deletions

View File

@@ -15,12 +15,14 @@ import { useDebounce } from 'use-debounce'
type Props = {
selectedItem?: string
items: string[]
debounceTimeout?: number
onValueChange?: (value: string) => void
} & InputProps
export const SearchableDropdown = ({
selectedItem,
items,
debounceTimeout = 1000,
onValueChange,
...inputProps
}: Props) => {
@@ -28,7 +30,7 @@ export const SearchableDropdown = ({
const [inputValue, setInputValue] = useState(selectedItem ?? '')
const [debouncedInputValue] = useDebounce(
inputValue,
process.env.NEXT_PUBLIC_E2E_TEST ? 0 : 1000
process.env.NEXT_PUBLIC_E2E_TEST ? 0 : debounceTimeout
)
const [filteredItems, setFilteredItems] = useState([
...items