wagtail / wagtail-generic-chooser

A toolkit for custom chooser popups in Wagtail
BSD 3-Clause "New" or "Revised" License
116 stars 25 forks source link

Consistently handle empty states from telepath / getState / setState #35

Closed gasman closed 3 years ago

gasman commented 3 years ago

setState needs to handle a dict with a blank 'value' field as an empty state, as that's what get_value_data returns for use in the telepath adapter, and what getState (used for block duplication) returns.

Without this, a newly-added block shows the buttons from the 'chosen' state: Screenshot 2021-07-22 at 18 09 20

gasman commented 3 years ago

Merged in 0f367b7788f5d8e10611ec8f9f05892dbd45da36