From c2383a6682e127c464846f3061ac8ef7150d78fd Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 4 Mar 2024 23:54:31 +0800 Subject: [PATCH] :bug: fix https://ld246.com/article/1705233964097 --- app/src/protyle/wysiwyg/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 566553ab9..b8dd2439b 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -877,7 +877,11 @@ export class WYSIWYG { let firstBlockElement = hasClosestBlock(firstElement); if (moveEvent.clientY > y) { if (!startFirstElement) { - startFirstElement = firstElement; + // 向上选择导致滚动条滚动到顶部再向下选择至 > y 时,firstBlockElement 为 undefined https://ld246.com/article/1705233964097 + if (!firstBlockElement) { + firstBlockElement = protyle.wysiwyg.element.firstElementChild as HTMLElement; + } + startFirstElement = firstBlockElement; } } else if (!firstBlockElement && // https://github.com/siyuan-note/siyuan/issues/7580