🐛 fix: Only update internalValue in MonacoEditor if propValue has changed

This commit is contained in:
web@ppanel 2025-12-29 09:49:48 +00:00
parent ba65588fdf
commit fe14002359

View File

@ -60,7 +60,10 @@ export function MonacoEditor({
const size = useSize(ref); const size = useSize(ref);
useEffect(() => { useEffect(() => {
setInternalValue(propValue); // Only update internalValue if propValue has actually changed and is different from current value
if (propValue !== internalValue) {
setInternalValue(propValue);
}
}, [propValue]); }, [propValue]);
const debouncedOnChange = useRef( const debouncedOnChange = useRef(