From 9c2bd33b7a3cd7b557723e9c18870dcd8d7bba6b Mon Sep 17 00:00:00 2001 From: Hufe921 Date: Mon, 17 Jul 2023 21:34:29 +0800 Subject: [PATCH] improve: cursor drawing when page visible --- src/editor/core/event/GlobalEvent.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/editor/core/event/GlobalEvent.ts b/src/editor/core/event/GlobalEvent.ts index 1b72d72..671554a 100644 --- a/src/editor/core/event/GlobalEvent.ts +++ b/src/editor/core/event/GlobalEvent.ts @@ -139,7 +139,10 @@ export class GlobalEvent { private _handleVisibilityChange = () => { if (document.visibilityState) { - this.cursor?.drawCursor() + const isCollapsed = this.range.getIsCollapsed() + this.cursor?.drawCursor({ + isShow: isCollapsed + }) } }