1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-07-31 04:20:26 +02:00

Revert insertText breaking change that deletes fragment (fixes #5153) (#5154)

This reverts commit 7499d4b4c0.

The issue reported at https://github.com/ianstormtaylor/slate/issues/4862
is a valid complaint, but change in https://github.com/ianstormtaylor/slate/pull/4868
is not an appropriate fix. It is a serious breaking change,
reported as bug: https://github.com/ianstormtaylor/slate/issues/5153

We should therefore revert the change. If we wish to fix Chromium's
triple-click bug, we should do so by unhanging the selection when it is
created; not by changing insertText behavior.
This commit is contained in:
Jim Fisher
2022-10-12 13:18:32 +01:00
committed by GitHub
parent d39943741f
commit 1b14de5f8e

View File

@@ -648,13 +648,6 @@ export const Editable = (props: EditableProps) => {
case 'insertFromYank':
case 'insertReplacementText':
case 'insertText': {
const { selection } = editor
if (selection) {
if (Range.isExpanded(selection)) {
Editor.deleteFragment(editor)
}
}
if (type === 'insertFromComposition') {
// COMPAT: in Safari, `compositionend` is dispatched after the
// `beforeinput` for "insertFromComposition". But if we wait for it