CMSgov / design-system

Open source design and front-end development resources for creating Section 508 compliant, responsive, and consistent websites.
https://design.cms.gov
Other
312 stars 85 forks source link

[WNMGDS-2848] Add ds-date-field web component #3182

Closed tamara-corbalt closed 1 month ago

tamara-corbalt commented 1 month ago

Summary

How to test

Checklist

If this is a change to design:

If this is a change to code:

If this is a change to documentation:

jack-ryan-nava-pbc commented 1 month ago

@tamara-corbalt It looks like the uncontrolled version of the React component is not functioning right because it is expecting an onChange function to be passed in.

If you observe the console while trying to make a change, you'll see a big red error blob of text.

tamara-corbalt commented 1 month ago

@jack-ryan-nava-pbc and & @pwolfert, I pushed up changes that should resolve the issues you called out. When time allows, let me know what you think!

pwolfert commented 1 month ago

If you observe the console while trying to make a change, you'll see a big red error blob of text.

@jack-ryan-nava-pbc, I realized after reading this that my PR never made onChange optional. But I don't actually know where you were seeing these errors. Can you list your reproduction steps?

tamara-corbalt commented 1 month ago

Hi @pwolfert! @jack-ryan-nava-pbc is out sick today. Here's how you should be able to reproduce the behavior Jack was referring to here:

  1. Go to this commit: Adds new storybook-doc snapshots.
  2. Run storybook locally
  3. Navigate to the "Uncontrolled Component" story for the SingleInputDateField.
  4. Open the browser console.
  5. Choose a date on the datepicker.

You should see the type error in the console as described.