wagtail-deprecated / wagtail-react-streamfield

Powerful field for inserting multiple blocks with nesting. (NO LONGER MAINTAINED - See Wagtail 2.13 Release Notes)
https://wagtail.github.io/react-streamfield/public/
BSD 3-Clause "New" or "Revised" License
74 stars 23 forks source link

DateTimeBlock value not updating when using date picker #41

Closed mike-hearn closed 5 years ago

mike-hearn commented 5 years ago

There appears to be a bug with StreamFields using the DateTimeBlock, where the field values are not updated in the React component when the value is chosen with the date/time picker. As a result, to a user the values appear to be updated on the front-end, but when saving the updated values are not sent to the backend and the new values are lost.

If I manually change the date/time value by typing it in, it does update the value in the component and the values will be saved to the object.

See this attached GIF for a demonstration of the bug:

datetimebug

mike-hearn commented 5 years ago

This issue turned out to be related to the fact that the date time plugin doesn't fire a change event, which is the event react-streamfield watches to update the value of its component. I made a PR on wagtail core to manually fire the change event on the input field, which appears to fix the bug.

When that PR is merged, this issue can be closed.

gasman commented 5 years ago

Fixed in https://github.com/wagtail/wagtail/pull/5415.