-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent submitting outer form when enter is pressed in Url/Unsplash plugin #4278
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change LGTM!
Is there some use case where actual form and submit event would be better, does handling
enter
key not cut it?
At least on iOS, we need to wrap the input in a form in order to get the blue submit button on the bottom right of the on screen keyboard. Without a form it will just show a grey "Return" key. So that's one argument for wrapping in a form.
Another argument for using a form
might be to improve accessibility - because a form has semantics, and everyone knows forms can be submitted with a standard submit action, while an input with an onKeyDown: if keyCode === 13
, is not very semantic.
I'm also interested in trying out putting a |
I would be all for using Why you would want that?
Example (I mean the drag-drop area this time): |
I think in this case we control the "submit" button, right? People are only allowed to add fields. |
Yes, but the current issue and PR is with the field, if you press |
let's go with form attribute then - best of both worlds |
Yep, originally @aduh95's idea, already implemented in
I will try to replicate this everywhere we have inputs with submits. |
Superseded by #4283 |
Related: transloadit/uppy.io#51
Problem: when Uppy Dashboard is wrapped in an outer
<form>
, pressingenter
on inputs inside Uppy submits that outer form, instead of confirming the input inside Uppy. This PR seems to resolve it in my tests.Is there some use case where actual form and submit event would be better, does handling
enter
key not cut it?