Skip to content

Commit

Permalink
fix: automatically inserts an empty text node after inserting an image (
Browse files Browse the repository at this point in the history
#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>
  • Loading branch information
CaptainCrouton89 and dylans authored Feb 9, 2024
1 parent b04b7e0 commit f0f4772
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions site/examples/images.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit f0f4772

Please sign in to comment.