Skip to content

Conversation

@oandregal
Copy link
Member

Part of #71500

What?

Add support for required and custom validation in the select control.

Why?

So that all controls support basic validation.

How?

Use the existing ValidatedSelectControl component.

Testing Instructions

In the storybook (npm run storybook:dev) verify that it can take required and custom validation in the "DataViews > DataForm > Validation" story:

Screen.Recording.2025-09-15.at.16.12.51.mov

@oandregal oandregal self-assigned this Sep 15, 2025
@github-actions
Copy link

github-actions bot commented Sep 15, 2025

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: oandregal <[email protected]>
Co-authored-by: andrewserong <[email protected]>

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

@oandregal oandregal added [Type] Enhancement A suggestion for improvement. [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond labels Sep 15, 2025
@oandregal oandregal requested review from andrewserong, jorgefilipecosta and ntsekouras and removed request for ajitbohra September 15, 2025 14:15
@oandregal oandregal mentioned this pull request Sep 15, 2025
4 tasks
@github-actions
Copy link

Flaky tests detected in 6b0c1bd.
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/17736188398
📝 Reported issues:

Copy link
Contributor

@andrewserong andrewserong left a comment

Choose a reason for hiding this comment

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

Tests well for me!

✅ Custom validation state works as expected (must select Option 1)
✅ Required validation state works as expected
✅ Toggling both off works as expected

LGTM!

@oandregal oandregal merged commit 228c3b5 into trunk Sep 16, 2025
70 checks passed
@oandregal oandregal deleted the update/dataform-validated-select branch September 16, 2025 07:00
@github-actions github-actions bot added this to the Gutenberg 21.7 milestone Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants