浏览代码

fix: text disappearing on edit (#8558) (#8624)

Mathis Beauville 10 月之前
父节点
当前提交
21815fb930
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      packages/excalidraw/components/App.tsx

+ 6 - 3
packages/excalidraw/components/App.tsx

@@ -4737,10 +4737,13 @@ class App extends React.Component<AppProps, AppState> {
           this.store.shouldCaptureIncrement();
         }
 
-        this.setState({
-          newElement: null,
-          editingTextElement: null,
+        flushSync(() => {
+          this.setState({
+            newElement: null,
+            editingTextElement: null,
+          });
         });
+
         if (this.state.activeTool.locked) {
           setCursorForShape(this.interactiveCanvas, this.state);
         }