Skip to content

Using editor.updateBlock while changing the content of the block deletes the children #1101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mfanselmo opened this issue Sep 24, 2024 · 1 comment · Fixed by #1103
Closed
Labels
bug Something isn't working

Comments

@mfanselmo
Copy link
Contributor

Describe the bug

When using the editor API editor.updateBlock and changing the block's content, the children are removed. I think this is unexpected behavior but please let me know if there is a reason for this, I have not looked very into detail in the code

To Reproduce

Screen.Recording.2024-09-24.at.1.49.47.PM.mov

https://stackblitz.com/edit/github-7jn7g7?file=SideMenuItems.tsx

@mfanselmo mfanselmo added the bug Something isn't working label Sep 24, 2024
@matthewlipski
Copy link
Collaborator

Nice find! Fortunately it's a one line fix (passing content replaces the content of the whole block including children). Will make a PR shortly👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants