datamade / just-spaces

🏕 A tool from University City District and DataMade to promote better and more just public spaces
https://justspacesproject.org
MIT License
7 stars 1 forks source link

CensusArea select widget won't display options when adding a new chart #189

Closed jeancochrane closed 5 years ago

jeancochrane commented 5 years ago

Something about the way we initialize Select2 for CensusArea widgets in the DAD is preventing them from showing options. If you remove this line, the input will show the right options, albeit without Select2 enabled:

https://github.com/datamade/just-spaces/blob/8a3336f58d71533704a6fe2f91ddd5f0353f7d12/surveys/templates/survey_submitted_detail.html#L115

One possible story is that, with the line in intact, Select2 will initialize the input UI in the context of the hidden form template (where it has no options) before the chart actually gets displayed. Then when we copy the hidden form template HTML to create a new chart form, it has no options:

https://github.com/datamade/just-spaces/blob/8a3336f58d71533704a6fe2f91ddd5f0353f7d12/surveys/templates/survey_submitted_detail.html#L243-L245