From c92f3bebf5fc4e9a1512be368f05d800ae1b92f7 Mon Sep 17 00:00:00 2001 From: YongJoon Kim Date: Thu, 9 Jan 2025 22:26:12 +0900 Subject: [PATCH] fix: change cursor by tool change immediately (#8212) --- packages/excalidraw/components/App.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/excalidraw/components/App.tsx b/packages/excalidraw/components/App.tsx index d2069a17f..7a19eeee0 100644 --- a/packages/excalidraw/components/App.tsx +++ b/packages/excalidraw/components/App.tsx @@ -4695,7 +4695,10 @@ class App extends React.Component { if (nextActiveTool.type === "hand") { setCursor(this.interactiveCanvas, CURSOR_TYPE.GRAB); } else if (!isHoldingSpace) { - setCursorForShape(this.interactiveCanvas, this.state); + setCursorForShape(this.interactiveCanvas, { + ...this.state, + activeTool: nextActiveTool, + }); } if (isToolIcon(document.activeElement)) { this.focusContainer();