@@ -7,7 +7,7 @@ import { ChangeEventHandlerControl } from "comps/controls/eventHandlerControl";
77import { UICompBuilder , withDefault } from "comps/generators" ;
88import { NameConfig , NameConfigHidden , withExposingConfigs } from "comps/generators/withExposing" ;
99import { Section , sectionNames } from "lowcoder-design" ;
10- import React , { Suspense , useEffect , useRef , useState } from "react" ;
10+ import React , { ChangeEvent , Suspense , useEffect , useRef , useState } from "react" ;
1111import type ReactQuill from "react-quill" ;
1212import { useDebounce } from "react-use" ;
1313import styled , { css } from "styled-components" ;
@@ -19,7 +19,7 @@ import {
1919 readOnlyPropertyView ,
2020 showDataLoadingIndicatorsPropertyView ,
2121} from "comps/utils/propertyUtils" ;
22- import _ from "lodash" ;
22+ import _ , { debounce } from "lodash" ;
2323import { trans } from "i18n" ;
2424import { default as Skeleton } from "antd/es/skeleton" ;
2525import { styleControl } from "comps/controls/styleControl" ;
@@ -294,9 +294,15 @@ function RichTextEditor(props: IProps) {
294294}
295295
296296const 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 ) ;
300306 } ;
301307
302308 return (
0 commit comments