Here is the HEEx template of a Phoenix.LiveComponent :
<form phx-submit="edit_line">
<button phx-click="add_field" phx-target={@myself}>add_field</button>
<button type="submit">submit</button>
</form>
When clicking on the button add_field , the handle_event “edit_line” of the parent live_view is called.
Moving the add_field button after the form closing tag makes everything work.
Is it a normal behavior ?
Something like any event (might be a press key event) coming from inside a form will be considered as a phx-submit event ?
Thank you.