Skip to content

Commit

Permalink
feat(core): prevent move selection when selection is in left or right…
Browse files Browse the repository at this point in the history
… cursor when click up #WIK-5900
  • Loading branch information
huanhuanwa committed Mar 18, 2024
1 parent 5d378b4 commit cec3452
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/shy-weeks-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"slate-angular": patch
---

prevent move selection when selection is in left or right cursor when click up
7 changes: 6 additions & 1 deletion packages/src/components/editable/editable.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,12 @@ export class SlateEditable implements OnInit, OnChanges, OnDestroy, AfterViewChe
return;
}

if (startVoid && endVoid && Path.equals(startVoid[1], endVoid[1])) {
if (
startVoid &&
endVoid &&
Path.equals(startVoid[1], endVoid[1]) &&
!(AngularEditor.isBlockCardLeftCursor(this.editor) || AngularEditor.isBlockCardRightCursor(this.editor))
) {
const range = Editor.range(this.editor, start);
Transforms.select(this.editor, range);
}
Expand Down

0 comments on commit cec3452

Please sign in to comment.