Skip to content

ValidatedInputControl: email fields should not show validation errors while typing #79515

Open

Description

@bluefuton

What problem does this address?

Validated email fields can currently show “Please include an @ in the email address” while the user is still typing an incomplete email address.

For example:

  1. Focus a required email field.
  2. Blur it while empty.
  3. See “Please fill out this field.”
  4. Focus it again and start typing.
  5. See “Please include an @ in the email address” until you've typed an @ character.

This feels noisy because partial email addresses are expected to be invalid while being typed, for example firstname.surname would display the error while typing every character.

This is a known UX issue with premature validation. Relevant guidance:

Image Image

What is your proposed solution?

Email fields should clear or hide the existing validation message while the user is editing, then re-check when the field blurs.

One possible implementation is to add a validation timing option, such as revalidateOn, to ControlWithError, surface it through ValidatedInputControl and DataViews controls, and default email fields to blur-based revalidation.

Testing

This can be reproduced in Storybook with ValidatedInputControl:

  1. Run npm run storybook:dev.
  2. Open Components / Selection & Input / Validated Form Controls / ValidatedInputControl.
  3. Set the type control to email.
  4. Make sure required is enabled.
  5. Focus the empty field, then blur it.
  6. Focus it again and start typing an email address.

Activity

  1. mirka commented on Jun 25, 2026

    @mirka
    Member

    This follows the standard validation behavior we agreed on, where:

    1. Initial state (untouched): No validation.
    2. On blur: Mark as touched, and validate for the first time.
    3. After being touched: Validate on every change.

    We shouldn't have special behaviors just for email validation, so there needs to be a decision on whether we want to change the standard behavior for the general case.

  2. ciampo commented on Jun 25, 2026

    @ciampo
    Contributor

    I can see how validating only on blur can be a UX improvement (as supported by the links in the original issue description), especially for input types such as email, URLs, and pattern-based fields.

    On the other hand, there are fields where intermediate invalid states are expected and useful (required fields clearing, password rules, async availability checks, or character limits).

    What about supporting both styles of validation, with different defaults depending on the field type (as proposed above), but with the ability to toggle it if needed via a prop?

    also cc @WordPress/gutenberg-design

  3. jasmussen commented on Jul 13, 2026

    @jasmussen
    Contributor

    No strong opinions on whether we do it onblur or on every change. I use a semi-dumbphone which is slow and cumbersome so I imagine onblur only would work better there, but I think the key for ensuring that works well is to ensure there are no layout shifts. If things jump around as you are typing, that feels like mostly a no-go to me.

    That's also why the main feedback I'd have looking purely at the visuals—thank you for contributing and providing them!—is that we should be as concise as possible. But I don't know if there's a bulletproof way to avoid layout shifts, especially on tiny phones that gets jumpy quick.

  4. mirka commented on Jul 15, 2026

    @mirka
    Member

    I think we may first want to try addressing the general case where fields are marked as touched even though they're not really touched from the perspective of the user. This happens on the second input field in this demo:

    CleanShot.2026-07-15.at.19-31-24.mp4

    This the probably the majority case where this UX issue is perceived, so it would be good to try addressing this globally before escalating to per-field customization.

  5. ciampo commented on Jul 15, 2026

    @ciampo
    Contributor

    Right: if a field blurs without having ever received value changes, we should not mark it as touched.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions