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(object-widget): highlight nested validation errors #7330

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

domcleal
Copy link
Contributor

Summary

When building nested controls for fields in an object widget, ensure the object's ID is passed through as a 'parent' so that errors in nested fields can be linked to the parent.

This ensures that a validation error on a field within an object will "bubble up" and show an error on a collapsed object's control in the editor, helping users to identify where there are validation errors.

Test plan

  1. Open the demo site
  2. Create a new Kitchen Sink collection entry
  3. Enter something for the title, click Save
  4. Scroll down to check the "Object" editor control and check if it's highlighted red

Before:

image

After:

image

Checklist

When building nested controls for fields in an object widget, ensure the
object's ID is passed through as a 'parent' so that errors in nested
fields can be linked to the parent.

This ensures that a validation error on a field within an object will
"bubble up" and show an error on a collapsed object's control in the
editor, helping users to identify where there are validation errors.
@domcleal domcleal marked this pull request as ready for review November 25, 2024 10:24
@domcleal domcleal requested a review from a team as a code owner November 25, 2024 10:24
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.

1 participant