Skip to content

Preserve nested group field values when readonly condition changes#26563

Merged
AlexGaillard merged 8 commits intomainfrom
hugo/cms-1354-fields-in-nested-group-loose-state-on-readonly-change
Feb 11, 2026
Merged

Preserve nested group field values when readonly condition changes#26563
AlexGaillard merged 8 commits intomainfrom
hugo/cms-1354-fields-in-nested-group-loose-state-on-readonly-change

Conversation

@HZooly
Copy link
Member

@HZooly HZooly commented Feb 2, 2026

Scope

What's changed:

  • Fix nested group fields losing values when a condition toggles the group's readonly property
  • Add tests for apply function in v-form component

Potential Risks / Drawbacks

  • Slightly more permissive: it accepts all form field keys from child updates regardless of readonly state

Tested Scenarios

  • Nested group with readonly condition toggled via checkbox - inner field values now persist
  • Non form field keys in updates are still filtered out
  • Meta keys starting with $ are preserved
  • Unit tests added for apply function

Review Notes / Questions

Checklist

  • Added or updated tests
  • Documentation PR created here or not required
  • OpenAPI package PR created here or not required

Fixes #25884 and #24815

@HZooly HZooly requested a review from AlexGaillard as a code owner February 2, 2026 16:21
@linear
Copy link

linear bot commented Feb 2, 2026

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2026


Code review

No issues found. Checked for bugs and CLAUDE.md compliance.


Copy link
Member

@AlexGaillard AlexGaillard left a comment

Choose a reason for hiding this comment

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

This looks pretty good. Some minor things here.

@HZooly
Copy link
Member Author

HZooly commented Feb 3, 2026

Updated with another array of keys that preserves the unchanged readonly values that are not in updatableKeys or updatableGroupKeys. Should fix #24815

Copy link
Contributor

@formfcw formfcw left a comment

Choose a reason for hiding this comment

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

Thank you @HZooly ❤️ Great work!

One minor thing to consider.

Copy link
Contributor

@formfcw formfcw left a comment

Choose a reason for hiding this comment

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

Thank you ❤️

LGTM 🎉

@HZooly HZooly requested a review from AlexGaillard February 11, 2026 00:31
Copy link
Member

@AlexGaillard AlexGaillard left a comment

Choose a reason for hiding this comment

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

🆒🫘

@AlexGaillard AlexGaillard merged commit 7c1dd03 into main Feb 11, 2026
72 checks passed
@AlexGaillard AlexGaillard deleted the hugo/cms-1354-fields-in-nested-group-loose-state-on-readonly-change branch February 11, 2026 00:48
@github-actions github-actions bot added this to the Next Release milestone Feb 11, 2026
AlexGaillard pushed a commit that referenced this pull request Feb 18, 2026
…26563)

* fix(v-form): preserve nested group field values when readonly condition changes

* Fix prettier

* preserve only grouped field values in v-form apply

* replace test by it

* rename updatable group keys variable

* fix: preserve readonly field values during nested form updates

* Check equality lodash util

---------

Co-authored-by: Florian C. Wachmann <[email protected]>
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.

Fields in nested group loose state on readonly-change

4 participants