Merge pull request #511 from SuanmoSuanyangTechnology/fix/release_web_zy
fix(web): jinja2 editor bugfix
This commit is contained in:
@@ -35,6 +35,12 @@ const InitialValuePlugin: React.FC<InitialValuePluginProps> = ({ value, options
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (value !== prevValueRef.current || enableLineNumbers !== prevEnableLineNumbersRef.current) {
|
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(() => {
|
queueMicrotask(() => {
|
||||||
editor.update(() => {
|
editor.update(() => {
|
||||||
const root = $getRoot();
|
const root = $getRoot();
|
||||||
|
|||||||
Reference in New Issue
Block a user