2.0.0-beta.133 insertContentAt change is causing bug when inserting nodes into empty paragraphs #2156
Closed
1 of 2 tasks
Labels
Type: Bug
The issue or pullrequest is related to a bug
What’s the bug you are facing?
When I try to insert nodes using
insertContent
into empty paragrapt only first one is inserted. Inserting next node replaces existing one.How can we reproduce the bug on our side?
Reproduction in CodeSandbox.
If you type something in the editor before clicking "Insert Emoji" it works as expected
Can you provide a CodeSandbox?
https://codesandbox.io/s/2-0-0-beta-137-o7qxh 2.0.0-beta.137 - broken
https://codesandbox.io/s/2-0-0-beta-132-kc79f 2.0.0-beta.132 - correct
What did you expect to happen?
Calling
insertContent
should insert content instead of replacing existing contentAnything to add? (optional)
Looks like
isOnlyBlockContent
is incorrect and does not check for content inside block nodestiptap/packages/core/src/commands/insertContentAt.ts
Lines 52 to 58 in 75e55e5
Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: