From 23befc661c572f0a7ff69fbae53acd0f21467d7a Mon Sep 17 00:00:00 2001 From: Deathsteps Date: Mon, 18 Sep 2023 13:46:42 +0800 Subject: [PATCH] fix: restore to last cursor not default --- src/interaction/utils.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/interaction/utils.ts b/src/interaction/utils.ts index f2d748a061..02c12650a2 100644 --- a/src/interaction/utils.ts +++ b/src/interaction/utils.ts @@ -451,11 +451,14 @@ export function setCursor(root, cursor) { // @ts-ignore const canvas = root.getRootNode().defaultView; const dom = canvas.getContextService().getDomElement(); - if (dom?.style) dom.style.cursor = cursor; + if (dom?.style) { + root.cursor = dom.style.cursor; + dom.style.cursor = cursor; + } } export function restoreCursor(root) { - setCursor(root, 'default'); + setCursor(root, root.cursor); } export function selectElementByData(elements, data, datum) {