Skip to content

Commit f0f4772

Browse files
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 <[email protected]>
1 parent b04b7e0 commit f0f4772

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

site/examples/images.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ const insertImage = (editor, url) => {
8282
const text = { text: '' }
8383
const image: ImageElement = { type: 'image', url, children: [text] }
8484
Transforms.insertNodes(editor, image)
85+
Transforms.insertNodes(editor, {
86+
type: 'paragraph',
87+
children: [{ text: '' }],
88+
})
8589
}
8690

8791
const Element = props => {

0 commit comments

Comments
 (0)