mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-04-21 13:51:59 +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:
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 (
|
||||
Element.isElement(currentNode) &&
|
||||
Editor.isVoid(editor, currentNode) &&
|
||||
Editor.isInline(editor, currentNode)
|
||||
(Editor.isInline(editor, currentNode) ||
|
||||
Editor.isBlock(editor, currentNode))
|
||||
) {
|
||||
event.preventDefault()
|
||||
Editor.deleteBackward(editor, { unit: 'block' })
|
||||
|
Loading…
x
Reference in New Issue
Block a user