wagtail-deprecated / wagtail-react-streamfield

Powerful field for inserting multiple blocks with nesting. (NO LONGER MAINTAINED - See Wagtail 2.13 Release Notes)

Home Page:https://wagtail.github.io/react-streamfield/public/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DateTimeBlock value not updating when using date picker

mike-hearn opened this issue · comments

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

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.