With a setting like below, and a put_change for program_id based on a custom validation rule for name, in the phx-change handle event, nothing happens for the select field
the program_id put _change is well reflected in the @changeset, but the select field does not move to the right value. If I put a text input field instead of the select, the put_change value is well reflected in the text input field.
the value in the put_change does exist in the select @options
<.form let={f} for={@changeset} id: “form” phx-target={@myself}, phx-change= “validate”, phx-submit= “save” >
<%= text_input f, :email %> <%= inputs_for f, :manyrel, fn v -> %> <%= text_input v, :name %> <%= select v, :program_id , @options%>
<% end %>
</.form>
the correct value can be accessed with
Changeset.get_fied(v.source, :program_id) and so manually forced with
<%= select v, :program_id , @options%, value: Changeset.get_field(v.source, :program_id) %>
but how come it auto updates for a text field and not for a select field ?