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

Elemental block validation not triggered on page save if the block hasn't been expanded #1183

Open
GuySartorelli opened this issue May 6, 2024 · 1 comment

Comments

@GuySartorelli
Copy link
Member

If I save the page without expanding the block, none of the validation seems to happen. e.g. with your test blocks from the description, I add the block and immediately save the page - it should trigger validation errors for the missing required fields but it doesn't.

Note that if you expand and collapse the block, the data is included in the page submission and therefore validated against correctly. This is only a problem when the block hasn't been expanded at all before clicking the save button.

Possible solution

We could always load the data for the form and render it, but just keep it hidden until the block gets expanded.

This would mean all page submissions would always include all data for all inline-editable blocks.
It would also mean we can do away with the logic we currently have for inline-saving blocks - we currently have logic to render a hidden form when inline-saving blocks (using the ... menu on the block) if the block wasn't expanded.

This would likely have a performance impact, especially for pages with a lot of blocks. We'd need to measure that.
That performance impact comes in two flavours:

  1. Page load time when loading the edit form for the page that owns the blocks
  2. Form submission time
@maxime-rainville
Copy link
Contributor

We have too many elemental cards in flight right now. Let's have an architecture catch up about them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants