mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-14 03:03:58 +02:00
Fix deletion of selected inline void nodes in Safari (#4331)
Co-authored-by: Claudéric Demers <clauderic.d@gmail.com>
This commit is contained in:
5
.changeset/safari-delete-inlinevoid.md
Normal file
5
.changeset/safari-delete-inlinevoid.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'slate-react': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix deletion of selected inline void nodes in Safari when presssing `backspace` or `delete`. This is a bug that [was originally fixed only for Google Chrome](https://github.com/ianstormtaylor/slate/issues/3456), but the fix also needs to be applied in Safari.
|
@@ -1066,8 +1066,8 @@ export const Editable = (props: EditableProps) => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (IS_CHROME) {
|
if (IS_CHROME || IS_SAFARI) {
|
||||||
// COMPAT: Chrome supports `beforeinput` event but does not fire
|
// COMPAT: Chrome and Safari support `beforeinput` event but do not fire
|
||||||
// an event when deleting backwards in a selected void inline node
|
// an event when deleting backwards in a selected void inline node
|
||||||
if (
|
if (
|
||||||
selection &&
|
selection &&
|
||||||
|
Reference in New Issue
Block a user