In a liveview, I have a form that is defined like this:
<.form let={f} for={:user} action={Routes.user_path(@socket, :create)} phx-change="validate_changeset" phx-debounce="blur", as={:user}>
...
</.form>
The submit button looks like this:
<%= submit "Save", phx_disable_with: "Saving...", disabled: {"#{!@trigger_variable_when_changeset_is_valid}"}%>.
All this is fine and dandy, but as soon as the trigger variable evaluates to true, all the fields in the form get cleared out and the button is disabled again. Can anyone explain this behavior and does anyone have a solution for this?