@@ -7,7 +7,7 @@ import { ChangeEventHandlerControl } from "comps/controls/eventHandlerControl";
7
7
import { UICompBuilder , withDefault } from "comps/generators" ;
8
8
import { NameConfig , NameConfigHidden , withExposingConfigs } from "comps/generators/withExposing" ;
9
9
import { Section , sectionNames } from "lowcoder-design" ;
10
- import React , { Suspense , useEffect , useRef , useState } from "react" ;
10
+ import React , { ChangeEvent , Suspense , useEffect , useRef , useState } from "react" ;
11
11
import type ReactQuill from "react-quill" ;
12
12
import { useDebounce } from "react-use" ;
13
13
import styled , { css } from "styled-components" ;
@@ -19,7 +19,7 @@ import {
19
19
readOnlyPropertyView ,
20
20
showDataLoadingIndicatorsPropertyView ,
21
21
} from "comps/utils/propertyUtils" ;
22
- import _ from "lodash" ;
22
+ import _ , { debounce } from "lodash" ;
23
23
import { trans } from "i18n" ;
24
24
import { default as Skeleton } from "antd/es/skeleton" ;
25
25
import { styleControl } from "comps/controls/styleControl" ;
@@ -294,9 +294,15 @@ function RichTextEditor(props: IProps) {
294
294
}
295
295
296
296
const RichTextEditorCompBase = new UICompBuilder ( childrenMap , ( props ) => {
297
- const handleChange = ( v : string ) => {
298
- props . value . onChange ( v ) ;
299
- props . onEvent ( "change" ) ;
297
+ const debouncedOnChangeRef = useRef (
298
+ debounce ( ( value : string ) => {
299
+ props . value . onChange ( value ) ;
300
+ props . onEvent ( "change" ) ;
301
+ } , 1000 )
302
+ ) ;
303
+
304
+ const handleChange = ( value : string ) => {
305
+ debouncedOnChangeRef . current ?.( value ) ;
300
306
} ;
301
307
302
308
return (
0 commit comments