Open
Description
While working with symfonycasts/dynamic-forms
I observed two issues which seem to stem from the same cause:
- A not-
expanded
ChoiceType
without placeholder whose value isnull
will appear as a<select>
with the first<option>
selected. The state of the component is then out-of-sync. - When refreshing a page with a form, browsers will populate fields with the value the user previously changed. As this happens without any user interaction, the component won’t be aware of these changes and will keep its default state.
The first issue can be worked around by adding a placeholder, and the second by setting to the fields which must keep their value the autocomplete
attribute to off
.
Maybe the component could react to the load
event to update its state?