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

@ -22,12 +22,14 @@ export type TextBoxProps = {
| ComponentWithAs<'textarea', TextareaProps>
| ComponentWithAs<'input', InputProps>
withVariableButton?: boolean
debounceTimeout?: number
} & Omit<InputProps & TextareaProps, 'onChange'>
export const TextBox = ({
onChange,
TextBox,
withVariableButton = true,
debounceTimeout = 1000,
...props
}: TextBoxProps) => {
const textBoxRef = useRef<(HTMLInputElement & HTMLTextAreaElement) | null>(
@ -39,7 +41,7 @@ export const TextBox = ({
(value) => {
onChange(value)
},
process.env.NEXT_PUBLIC_E2E_TEST ? 0 : 1000
process.env.NEXT_PUBLIC_E2E_TEST ? 0 : debounceTimeout
)
useEffect(