Hi!
Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a newline to my input field (which is expected behaviour).
Is there a way to make submit work on pressing the Enter key without messing up the way the form is cleared after submitting?
I’m using below code to make the form work. This form works properly when the type of the input element is the default text type rather than a “textarea”.
<div class="flex items-center py-2">
<.form for={@form} phx-submit="save" phx-change="update" phx-target={@myself} >
<.input type="textarea" field={@form[:content]} placeholder="Start typing..." autocomplete="off"/>
<.button class="text-black" phx-disable-with="Submit">
Submit
</.button>
</.form>
</div>
Cheers,
Sil






















