Pressing enter while on Title and Summary field submits the post
This is a continuation from here.
When Title or Summary input field is focused and enter key is pressed, it submits the post. This may result in incomplete post draft to be submitted if the user is not careful.
Steps to reproduce:
- Open the Share form
- Put in some content*
- Focus either on Title or Summary field
- Press enter
* The content may have to be unique, otherwise it may see it as duplicate post and the behavior might not be reproduced. Adding random numbers/chars does the trick usually.
Current behavior:
It submits the form and it's posted right away.
Expected behavior:
Doesn't submit or do anything when enter is pressed.
While it may be against browser standards as @mario pointed out here, it can be "fixed" (with JS probably?) if we want to and I think it should be more logical to do.
As an example, on Mastodon if I click the CW button, and while on the warning field (which is similar to Summary field that we have) I press enter, it doesn't submit. Even if I take the browser standard argument, if I press enter while focused on the Categories field on Hubzilla share form, it doesn't submit. So there is inconsistency in the behavior I suppose?