Skip to content
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

Fix initialValue block setting #5978

Merged
merged 4 commits into from
Aug 26, 2024
Merged

Fix initialValue block setting #5978

merged 4 commits into from
Aug 26, 2024

Conversation

wesleybl
Copy link
Member

@wesleybl wesleybl commented Apr 23, 2024

This fixes initialValue block setting in two situations:

  • When the previous block is an empty block:

In this situation, only the onChangeBlock method was called, which does not call the applyBlockInitialValue method. Then we call the applyBlockInitialValue method before calling onChangeBlock.

  • When the previous block is not an empty block:

In this situation, the insertBlock method is called. But it passed the id of the previous block to the applyBlockInitialValue method, instead of the id of the new created block.

fixes #5971

Copy link

netlify bot commented Apr 23, 2024

Deploy Preview for volto canceled.

Name Link
🔨 Latest commit 5588d72
🔍 Latest deploy log https://app.netlify.com/sites/volto/deploys/6638fafc6f7cd30008aa449d

Copy link

netlify bot commented Apr 23, 2024

Deploy Preview for plone-components canceled.

Name Link
🔨 Latest commit 106406f
🔍 Latest deploy log https://app.netlify.com/sites/plone-components/deploys/66ccab5368a84f0008be405f

@wesleybl wesleybl requested a review from sneridagh April 23, 2024 20:56
wesleybl added 2 commits May 6, 2024 12:48
In this situation, only the onChangeBlock method was called, which does
not call the _applyBlockInitialValue method. Then we call the
_applyBlockInitialValue method before calling onChangeBlock.
block

In this situation, the insertBlock method is called. But it passed the
id of the previous block to the _applyBlockInitialValue method, instead
of the id of the new created block.
@wesleybl wesleybl requested a review from ichim-david May 6, 2024 15:54
Copy link
Member

@sneridagh sneridagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ichim-david can I have your final review?

@davisagli davisagli merged commit 84b7ee8 into main Aug 26, 2024
70 checks passed
@davisagli davisagli deleted the initial_value branch August 26, 2024 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

initialValue block setting doesn't work
4 participants