mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-12 10:14:02 +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
|
||||
}
|
||||
} else {
|
||||
if (IS_CHROME) {
|
||||
// COMPAT: Chrome supports `beforeinput` event but does not fire
|
||||
if (IS_CHROME || IS_SAFARI) {
|
||||
// COMPAT: Chrome and Safari support `beforeinput` event but do not fire
|
||||
// an event when deleting backwards in a selected void inline node
|
||||
if (
|
||||
selection &&
|
||||
|
Reference in New Issue
Block a user