Merge pull request #511 from SuanmoSuanyangTechnology/fix/release_web_zy

fix(web): jinja2 editor bugfix
This commit is contained in:
yingzhao
2026-03-07 14:53:26 +08:00
committed by GitHub

View File

@@ -35,6 +35,12 @@ const InitialValuePlugin: React.FC<InitialValuePluginProps> = ({ value, options
useEffect(() => {
if (value !== prevValueRef.current || enableLineNumbers !== prevEnableLineNumbersRef.current) {
// Skip reset if the change was triggered by user input (avoid cursor jump)
if (isUserInputRef.current && enableLineNumbers === prevEnableLineNumbersRef.current) {
prevValueRef.current = value;
isUserInputRef.current = false;
return;
}
queueMicrotask(() => {
editor.update(() => {
const root = $getRoot();