gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Validated form controls: Add more validation examples

Open mirka opened this issue 1 month ago β€’ 3 comments

What?

Adds two more examples to the Validated form control stories:

  • Validate with other field state
  • Validate on submit

Why?

Developers were asking about this kind of use case.

Testing Instructions

See the new stories in the "Validated form controls" Overview section.

Screenshots or screencast

New stories

mirka avatar Nov 21 '25 15:11 mirka

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: mirka <[email protected]>
Co-authored-by: getdave <[email protected]>
Co-authored-by: juanfra <[email protected]>
Co-authored-by: aduth <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

github-actions[bot] avatar Nov 21 '25 16:11 github-actions[bot]

Small nit: we might want to mark the fields in both examples as required. If someone submits with empty fields, it can feel like the validation isn’t working since the form still goes through. Not specific to the stories, more of a UX detail.

Good call (a05c559). Thanks for keeping an eye on the UX details πŸ™

mirka avatar Nov 24 '25 14:11 mirka

Flaky tests detected in a05c55957094e43be70133a1e5de770c7e9ca1cd. Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

πŸ” Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/19638032155 πŸ“ Reported issues:

  • #47897 in /test/e2e/specs/site-editor/template-revert.spec.js

github-actions[bot] avatar Nov 24 '25 15:11 github-actions[bot]