Skip to content

Commit

Permalink
fix: #3773 - Array for content breaks editor (#3786)
Browse files Browse the repository at this point in the history
* fix: #3773 - Array for content breaks editor

* fix: lint warning
  • Loading branch information
gethari committed Feb 24, 2023
1 parent 8bf8fd2 commit 89cc59a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/helpers/createNodeFromContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function createNodeFromContent(

if (typeof content === 'object' && content !== null) {
try {
if (Array.isArray(content)) {
if (Array.isArray(content) && content.length > 0) {
return Fragment.fromArray(content.map(item => schema.nodeFromJSON(item)))
}

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/EditorContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class PureEditorContent extends React.Component<EditorContentProps, Edito
// a lifecycle method.
if (this.initialized) {
queueMicrotask(() => {
flushSync(fn)
flushSync(fn)
})
} else {
fn()
Expand Down

0 comments on commit 89cc59a

Please sign in to comment.