From 72a8692ad784f37b429be8592a6c71b5b0c765d4 Mon Sep 17 00:00:00 2001 From: yongzs <673262625@qq.com> Date: Wed, 23 Mar 2022 12:24:23 +0800 Subject: [PATCH] fixed4811 --- .../slate-react/src/components/editable.tsx | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/packages/slate-react/src/components/editable.tsx b/packages/slate-react/src/components/editable.tsx index 65f92eef8c..fecc55411a 100644 --- a/packages/slate-react/src/components/editable.tsx +++ b/packages/slate-react/src/components/editable.tsx @@ -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