Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

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

Mathis Beauville21815fb930f2
diff --git a/packages/excalidraw/components/App.tsx b/packages/excalidraw/components/App.tsx
index 8a976dd8bf..b5f592651d 100644
--- a/packages/excalidraw/components/App.tsx
+++ b/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);
}