Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Address va-memorable-date validation edge cases when not required #4819

Description

@jamigibbs

Description

There are two validation edge cases that we should look into:

1. Using spaces in the inputs causes fields to display an error border but no error message (non-required field)

Steps to reproduce:

  1. In Storybook, in the Month input, type a space
  2. In the Day input, type a space
  3. In the Year input, type a space

Observe that the inputs are showing an error border but there is no error message (ie. "Please enter a month between 1 and 12").

Image

What I expect to happen

I'm not sure if the expected behavior is for full validation to run which includes displaying the validation error message(s), or, if spaces in inputs should be sanitized. I'm leaning towards sanitization (no error displayed) but we might want to confirm with the team.

2. Validation error does not unset after clearing out values (non-required field)

Steps to reproduce

  1. In Storybook, in the Month, Day, and Year inputs type 10 10 2010
  2. Tab out and observe there is no validation error
  3. Go to Month, Day, and Year and delete all inputs.
  4. In the Month, Day, and Year inputs type 10 10 20.
  5. Tab out and observe the year shows a validation error.
  6. Go to Month, Day, and Year and delete all inputs.
  7. Tab out of the component.

Observe the year still shows a validation error:

Image

What I expect to happen

I expect that if there is a validation error but I clear out all of the inputs, the validation error would automatically go away without me needed to enter any other values.

Screen.Recording.2025-09-12.at.9.07.16.AM.mov

Tasks

  • Validate the two validation issues above
  • Update the validation utils file and/or component so that it addresses those issues.
  • Check the va-date component too

Acceptance Criteria

  • [ ]

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions