Skip to content

Commit

Permalink
update insertText logic when selection is not collapsed (ianstormtayl…
Browse files Browse the repository at this point in the history
…or#4804)

* update insertText logic when selection is not collapsed

* add changeset

* fix bug when end of range is void

Co-authored-by: zhangpengcheng15 <zhangpengcheng15@jd.com>
  • Loading branch information
suilang and zhangpengcheng15 authored Jan 28, 2022
1 parent d25bed0 commit 64f194e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/transforms/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,12 +484,11 @@ export const TextTransforms: TextTransforms = {
at = at.anchor
} else {
const end = Range.end(at)

if (!voids && Editor.void(editor, { at: end })) {
return
}

const pointRef = Editor.pointRef(editor, end)
const start = Range.start(at)
const pointRef = Editor.pointRef(editor, start)
Transforms.delete(editor, { at, voids })
at = pointRef.unref()!
Transforms.setSelection(editor, { anchor: at, focus: at })
Expand Down

0 comments on commit 64f194e

Please sign in to comment.