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(live-preview): client-side live preview cannot clear all array rows #9439

Merged
merged 5 commits into from
Nov 22, 2024

Conversation

jacobsfletch
Copy link
Member

@jacobsfletch jacobsfletch commented Nov 22, 2024

When using Client-side Live Preview, array fields are unable to clear all their rows. This is because reduceFieldsToValues sets the array's value as 0 within form-state when no rows exist, as opposed to an empty array as one might expect. For now, we can simply handle this data shape within Live Preview's merge logic. In the future we may want to take to consider changing the behavior of empty arrays within form-state itself.

@jacobsfletch jacobsfletch enabled auto-merge (squash) November 22, 2024 16:34
@jacobsfletch jacobsfletch merged commit ae6c71b into main Nov 22, 2024
52 checks passed
@jacobsfletch jacobsfletch deleted the fix/client-live-preview-arrays branch November 22, 2024 16:43
Copy link

🚀 This is included in version v3.1.0

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

Successfully merging this pull request may close these issues.

1 participant