From 21815fb930f282fdd5ef86c0877b0bd82f3dead1 Mon Sep 17 00:00:00 2001 From: Mathis Beauville <45576315+ObstinateM@users.noreply.github.com> Date: Thu, 17 Oct 2024 13:11:48 +0200 Subject: [PATCH] fix: text disappearing on edit (#8558) (#8624) --- packages/excalidraw/components/App.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/excalidraw/components/App.tsx b/packages/excalidraw/components/App.tsx index 8a976dd8b..b5f592651 100644 --- a/packages/excalidraw/components/App.tsx +++ b/packages/excalidraw/components/App.tsx @@ -4737,10 +4737,13 @@ class App extends React.Component { 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); }