Skip to content

Commit 0a4314e

Browse files
fix cursor jumping issue
1 parent b2675ad commit 0a4314e

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

client/packages/lowcoder/src/base/codeEditor/codeEditor.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,13 @@ function useCodeMirror(
220220
const showLineNum = props.showLineNum ?? getStyle(props.styleName).showLineNum;
221221

222222
const handleChange = useCallback(
223-
debounce((state: EditorState) => {
223+
(state: EditorState) => {
224224
window.clearTimeout(isTypingRef.current);
225-
isTypingRef.current = window.setTimeout(() => (isTypingRef.current = 0), 100);
226-
onChange?.(state);
227-
}, 1000)
225+
isTypingRef.current = window.setTimeout(() => {
226+
isTypingRef.current = 0;
227+
onChange?.(state);
228+
}, 500);
229+
}
228230
, [onChange]
229231
);
230232

client/packages/lowcoder/src/comps/comps/ratingComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const RatingBasicComp = (function () {
7878
children: (
7979
<RateStyled
8080
count={props.max}
81-
value={props.value.value}
81+
value={value}
8282
onChange={(e) => {
8383
props.value.onChange(e);
8484
changeRef.current = true;

client/packages/lowcoder/src/layout/compSelectionWrapper.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,8 @@ export const CompSelectionWrapper = React.memo((props: {
369369
{!needResizeDetector && props.children}
370370
{needResizeDetector && (
371371
<ReactResizeDetector
372-
skipOnMount
372+
refreshMode="debounce"
373+
refreshRate={250}
373374
onResize={props.onInnerResize}
374375
observerOptions={{ box: "border-box" }}
375376
>

0 commit comments

Comments
 (0)