Shopify / ui-extensions

MIT License
265 stars 37 forks source link

[POS UI Extensions] Empty DateField displays today's date #2099

Open timvandam opened 3 months ago

timvandam commented 3 months ago

Please list the package(s) involved in the issue, and include the version you are using

@shopify/retail-ui-extensions-react@1.6.0

Describe the bug

Empty date fields display today's date rather than being empty. That's not nice for optional date fields

If you omit the value prop, set it to undefined or provide an invalid date it will default to today's date

Steps to reproduce the behavior:

  1. <DateField label="asd" />
  2. <DateField label="asd" value={undefined} />
  3. <DateField label="asd" value={'some invalid value'} />

Expected behavior

It should be empty

Screenshots

Additional context

timvandam commented 3 months ago

Correction: it defaults to the previously shown date, not to today