Skip to content

Commit

Permalink
Revert insertText breaking change that deletes fragment (fixes #5153) (
Browse files Browse the repository at this point in the history
…#5154)

This reverts commit 7499d4b.

The issue reported at #4862
is a valid complaint, but change in #4868
is not an appropriate fix. It is a serious breaking change,
reported as bug: #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.
  • Loading branch information
jameshfisher authored Oct 12, 2022
1 parent d399437 commit 1b14de5
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions packages/slate-react/src/components/editable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1b14de5

Please sign in to comment.