Skip to content

Conversation

@mirka
Copy link
Member

@mirka mirka commented Aug 20, 2025

What?

Adds stories to demonstrate how validation can work in popovers.

Why?

There have been questions about how to make validation behave in popovers.

Testing Instructions

In the Validated Form Controls ▸ Overview section, see the "Validate in modal" and "Validate on popover close" stories.

Screenshots or screencast

CleanShot.2025-11-21.at.02-56-14.mp4
CleanShot.2025-11-21.at.02-57-51.mp4

@mirka mirka self-assigned this Aug 20, 2025
@mirka mirka added [Type] Developer Documentation Documentation for developers [Package] Components /packages/components Storybook Storybook and its stories for components labels Aug 20, 2025
@github-actions
Copy link

github-actions bot commented Aug 20, 2025

Flaky tests detected in 7d00d9b.
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/20141444021
📝 Reported issues:

@mirka mirka force-pushed the validate-in-popover branch from 7bd9c69 to e10072b Compare November 18, 2025 18:55
@mirka mirka changed the title Validated form controls: Add story for validation in popover Validated form controls: Add stories for validation in popovers Nov 18, 2025
@mirka mirka marked this pull request as ready for review November 24, 2025 09:11
@mirka mirka requested a review from ajitbohra as a code owner November 24, 2025 09:11
@mirka mirka requested a review from a team November 24, 2025 09:12
@github-actions
Copy link

github-actions bot commented Nov 24, 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: mirka <[email protected]>
Co-authored-by: juanfra <[email protected]>

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

Copy link
Member

@juanfra juanfra left a comment

Choose a reason for hiding this comment

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

Thanks so much for the PR! I noticed two things while testing:

  1. Hitting Enter inside the popover submits the form and navigates away. That might not be the intended behavior for this example.
  2. Since the render here is a bit more complex, the code docs aren't generated automatically. It might be worth adding the code snippet manually so folks browsing the stories have the full context.
form-controls-modal-popover.mp4

# Conflicts:
#	packages/components/src/validated-form-controls/components/stories/overview.story.tsx
@mirka
Copy link
Member Author

mirka commented Dec 11, 2025

  • Hitting Enter inside the popover submits the form and navigates away.

Fixed in 75281c6

  • Since the render here is a bit more complex, the code docs aren't generated automatically. It might be worth adding the code snippet manually so folks browsing the stories have the full context.

Very valid point. In fact the auto-generated snippets are not great in general, but we also have the maintenance concern where we don't want to manually maintain all these snippets, as they're quite error-prone. We have future plans for a dedicated reference site (not Storybook-based) where we can have high-quality snippets that are more maintainable, and can also be reused in a code sandbox or a live render, for example.

@mirka mirka requested a review from juanfra December 11, 2025 17:58
@mirka
Copy link
Member Author

mirka commented Dec 11, 2025

These are now rebased onto the latest changes, and ready for final review 🙏

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

Labels

[Package] Components /packages/components Storybook Storybook and its stories for components [Type] Developer Documentation Documentation for developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants