Skip to content
This repository was archived by the owner on Oct 27, 2022. It is now read-only.

DatePicker setting date to nullΒ #42

Open
@alexbeletsky

Description

@alexbeletsky

I have a form where DatePicker is used, I can set some particular field with a date value and save the form. After, I want to delete the date to make it null. As I remove value completely, two things happen.

  1. moment.js writes a warning to console,

screenshot 2016-09-16 12 23 08

1. `onChange` handler of field is _not_ triggered. 2. If I reload the form, I can see the date is still there (so, a null field is not submitted to a server).

From code, I see that once a value is removed from the input field, getStateFromProps() will receive an empty string and construct default moment object.

I believe this behavior is wrong and prevents to set fields to null.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions