mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-14 11:14:04 +02:00
Fix deletion of expanded range (#4549)
This commit is contained in:
@@ -310,6 +310,10 @@ export const Editable = (props: EditableProps) => {
|
||||
}
|
||||
}
|
||||
|
||||
if (!native) {
|
||||
event.preventDefault()
|
||||
}
|
||||
|
||||
// COMPAT: For the deleting forward/backward input types we don't want
|
||||
// to change the selection because it is the range that will be deleted,
|
||||
// and those commands determine that for themselves.
|
||||
@@ -424,7 +428,7 @@ export const Editable = (props: EditableProps) => {
|
||||
// Potentially expand to single character deletes, as well.
|
||||
if (native) {
|
||||
asNative(editor, () => Editor.insertText(editor, data), {
|
||||
onFlushed: () => (native = false),
|
||||
onFlushed: () => event.preventDefault(),
|
||||
})
|
||||
} else {
|
||||
Editor.insertText(editor, data)
|
||||
@@ -434,10 +438,6 @@ export const Editable = (props: EditableProps) => {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (!native) {
|
||||
event.preventDefault()
|
||||
}
|
||||
}
|
||||
},
|
||||
[readOnly, propsOnDOMBeforeInput]
|
||||
|
Reference in New Issue
Block a user