From 3d7b6638e1ca5da6a632fd3779de0bf43cac3bdb Mon Sep 17 00:00:00 2001 From: pubuzhixing8 Date: Tue, 7 Apr 2026 16:26:46 +0800 Subject: [PATCH] fix(virtual-scroll): fix shift selection do not work as expected issue #WIK-19914 --- .changeset/rude-bats-hug.md | 8 ++++++++ packages/src/components/editable/editable.component.ts | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changeset/rude-bats-hug.md diff --git a/.changeset/rude-bats-hug.md b/.changeset/rude-bats-hug.md new file mode 100644 index 0000000..5c217f0 --- /dev/null +++ b/.changeset/rude-bats-hug.md @@ -0,0 +1,8 @@ +--- +'slate-angular': patch +--- + +fix shift selection do not work as expected issue +apply selection even though it is collapsed to ensure the doms which contains the selection is rendered + + diff --git a/packages/src/components/editable/editable.component.ts b/packages/src/components/editable/editable.component.ts index f9ad92c..25a90d6 100644 --- a/packages/src/components/editable/editable.component.ts +++ b/packages/src/components/editable/editable.component.ts @@ -527,7 +527,7 @@ export class SlateEditable implements OnInit, OnChanges, OnDestroy, AfterViewChe } calculateIndicsStartAndEndBySelection() { - if (!this.editor.selection || Range.isCollapsed(this.editor.selection)) { + if (!this.editor.selection) { return; } const isBackward = Range.isBackward(this.editor.selection);