team-formalist / formalist-rb

Flexible form builder
MIT License
22 stars 4 forks source link

Date time fields cannot be cleared #65

Closed andrewcroome closed 6 years ago

andrewcroome commented 6 years ago

It seems that once a date time field has a value, it cannot be cleared.

There appears to be two issues:

  1. Selecting date content and using the delete key to clear it results in an error from the Datepicker:
Uncaught TypeError: Cannot read property 'showMonth' of null
    at DatePicker._this.showCurrentDate (index.js:79)
  1. Deleting one character at a time will clear the field, but the values that were in the fields are still sent on form submission.

i.e. this value is sent:

"published_from"=>"2018-01-16T01:00:00+11:00"

Rather than:

"published_from"=>""