Skip to content

Commit

Permalink
fixed4811
Browse files Browse the repository at this point in the history
  • Loading branch information
sennpang committed Mar 23, 2022
1 parent 9478834 commit 72a8692
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions packages/slate-react/src/components/editable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -837,20 +837,22 @@ export const Editable = (props: EditableProps) => {
Editor.deleteFragment(editor)
return
}
const inline = Editor.above(editor, {
match: n => Editor.isInline(editor, n),
mode: 'highest',
})
if (inline) {
const [, inlinePath] = inline
if (Editor.isEnd(editor, selection.anchor, inlinePath)) {
const point = Editor.after(editor, inlinePath)!
Transforms.setSelection(editor, {
anchor: point,
focus: point,
})
}
}

// const inline = Editor.above(editor, {
// match: n => Editor.isInline(editor, n),
// mode: 'highest',
// })
// if (inline) {
// const [, inlinePath] = inline
// if (Editor.isEnd(editor, selection.anchor, inlinePath)) {
// const point = Editor.after(editor, inlinePath)!
// Transforms.setSelection(editor, {
// anchor: point,
// focus: point,
// })
// }
// }

// insert new node in advance to ensure composition text will insert
// along with final input text
// add Unicode BOM prefix to avoid normalize removing this node
Expand Down

0 comments on commit 72a8692

Please sign in to comment.