Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date & DateTime widgets do not respect falsy/null/non-date ui:emptyValue #2889

Closed
4 tasks done
thgreasi opened this issue Jun 23, 2022 · 1 comment
Closed
4 tasks done
Assignees
Labels
bug needs triage Initial label given, to be assigned correct labels and assigned

Comments

@thgreasi
Copy link

Prerequisites

What theme are you using?

core

Version

4.1.1

Current Behavior

For Date & DateTime fields of type "type": ["string", "null"], that do have "ui:emptyValue": null configured, clearing the input results the property to be completely removed from the result object.

Expected Behavior

For Date & DateTime fields of type "type": ["string", "null"], configured with "ui:emptyValue": null in their UISchema, should set a null value in the result object, consistently with how string & number fields behave.

Steps To Reproduce

  1. go to to this shared playground.
  2. set a value to the text, number, date & datetime fields and clear them afterwards.
  3. while for the text & numeric fields the result object will have a property with null as a value, the form will not include at all properties for the date & datetime fields.

Environment

- OS: Ubuntu 20.04
- Node: 16.15.1
- npm: 8.12.2

Anything else?

No response

@thgreasi thgreasi added bug needs triage Initial label given, to be assigned correct labels and assigned labels Jun 23, 2022
@thgreasi thgreasi changed the title Date & DateTime widgets do not respect falsy ui:emptyValue Date & DateTime widgets do not respect falsy/null/non-date ui:emptyValue Jun 24, 2022
@heath-freenome
Copy link
Member

Fixed in the v5 beta, see the 5.x migration guide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs triage Initial label given, to be assigned correct labels and assigned
Projects
None yet
Development

No branches or pull requests

4 participants