1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-30 10:29:48 +02:00

fix: automatically inserts an empty text node after inserting an image (#5598)

* fix: automatically inserts an empty text node after inserting an image

Fixes #5597

* Update site/examples/images.tsx

* Update site/examples/images.tsx

* Update site/examples/images.tsx

---------

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
This commit is contained in:
Silas Rhyneer
2024-02-09 06:54:51 -06:00
committed by GitHub
parent b04b7e0e98
commit f0f4772264

View File

@@ -82,6 +82,10 @@ const insertImage = (editor, url) => {
const text = { text: '' }
const image: ImageElement = { type: 'image', url, children: [text] }
Transforms.insertNodes(editor, image)
Transforms.insertNodes(editor, {
type: 'paragraph',
children: [{ text: '' }],
})
}
const Element = props => {