mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-01 21:10:14 +02:00
Make it possible to delete block elements with backspace on Chrome and Safari (#5123)
* Make it possible to delete block elements with backspace in chrome and safari * Add changeset
This commit is contained in:
committed by
GitHub
parent
341041f0b7
commit
0eb37e7915
5
.changeset/good-cats-warn.md
Normal file
5
.changeset/good-cats-warn.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'slate-react': minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Make it possible to delete block elements with backspace in Chrome and Safari
|
@@ -1561,7 +1561,8 @@ export const Editable = (props: EditableProps) => {
|
|||||||
if (
|
if (
|
||||||
Element.isElement(currentNode) &&
|
Element.isElement(currentNode) &&
|
||||||
Editor.isVoid(editor, currentNode) &&
|
Editor.isVoid(editor, currentNode) &&
|
||||||
Editor.isInline(editor, currentNode)
|
(Editor.isInline(editor, currentNode) ||
|
||||||
|
Editor.isBlock(editor, currentNode))
|
||||||
) {
|
) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
Editor.deleteBackward(editor, { unit: 'block' })
|
Editor.deleteBackward(editor, { unit: 'block' })
|
||||||
|
Reference in New Issue
Block a user