File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
frontend/src/app/components/FormGenerator/Basic Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1919import { Input } from 'antd' ;
2020import useDebouncedFormValue from 'app/hooks/useDebouncedFormValue' ;
2121import { ChartStyleConfig } from 'app/types/ChartConfig' ;
22- import { FC , memo } from 'react' ;
22+ import { FC , memo , useCallback } from 'react' ;
2323import styled from 'styled-components/macro' ;
2424import { ItemLayoutProps } from '../types' ;
2525import { itemLayoutComparer } from '../utils' ;
@@ -38,13 +38,20 @@ const BasicInput: FC<ItemLayoutProps<ChartStyleConfig>> = memo(
3838 onChange ,
3939 ) ;
4040
41+ const inputOnChange = useCallback (
42+ e => {
43+ debouncedUpdateValue ( e . target . value ) ;
44+ } ,
45+ [ debouncedUpdateValue ] ,
46+ ) ;
47+
4148 return (
4249 < Wrapper label = { t ( data ?. label , true ) } >
4350 < Input
4451 { ...rest }
4552 { ...options }
4653 value = { formValue }
47- onChange = { debouncedUpdateValue }
54+ onChange = { inputOnChange }
4855 defaultValue = { data ?. default }
4956 />
5057 </ Wrapper >
You can’t perform that action at this time.
0 commit comments