Skip to content

Value property changing to null does not clear Input element's text if clearOnSameDateClick is false #693

Closed
@MutatedGamer

Description

@MutatedGamer

🐛 bug report

Description of the problem

If a SemanticDatepicker has a value property being passed in, setting the property to null does not cause the inner Input element value to change if clearOnsameDateClick is false. This results in the text not updating, even though the value of the component has been updated.

In the sandbox link below, perform the following actions:

  1. Select a date value
  2. Click the "Set to Null" button
  3. Inspect the components in React DevTools. The outer SemanticDatepicker has a correct value of null, but the inner Input has the old value.

How has this issue affected you? What are you trying to accomplish?

This is a blocker when using Formik to handle the field's value. Specifically, I am trying to have Formik "reset" the form (I have a form inside a modal and want the form to clear when the modal is opened again). Formik's resetForm() will update all the field values, giving the SemanticDatepicker a new default value of null; visually, however, the form still has the previous value.

Link to a sandbox: here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions