MoOx / pjax

Easily enable fast Ajax navigation on any website (using pushState + xhr)
MIT License
1.46k stars 125 forks source link

Form Submits on Enter Even for Textarea #181

Closed chaiim closed 6 years ago

chaiim commented 6 years ago

So it seems like pressing enter always submits a form request. I believe the expected behavior is only when there is one input in a form. But the main issue is just that it submits for textarea inputs instead of allowing the user to continue typing which is the expected behavior of a textarea.

BehindTheMath commented 6 years ago

Based on the spec:

So the textarea issue is definitely a bug. The input issue is not, if your form has a submit button.

I'm going to remove the unnecessary keyup event listener, and let the browser make the decision when to submit the form.