Skip to content
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

Replace click listeners on submit buttons with submit listeners on forms #1064

Open
lukaw3d opened this issue Oct 5, 2022 · 2 comments
Open
Labels
bug Something isn't working

Comments

@lukaw3d
Copy link
Member

lukaw3d commented Oct 5, 2022

Related to #1037 (review)

Although accessibility is good in both cases (both trigger submit on Enter and on click), only <Form onSubmit handles validation. Fix it upstream or add types+lint to enforce correct usage.

Before:

<Form>
  <Button type="submit" onClick={onSubmit}>

After:

<Form onSubmit={onSubmit}>
  <Button type="submit">
@alexander-elgin
Copy link
Contributor

@lukaw3d please, can you assign the issue to me? I submitted a PR fixing it

@lukaw3d
Copy link
Member Author

lukaw3d commented Oct 11, 2022

Sure!
I'll keep the issue open for the "Fix it upstream or add types+lint to enforce correct usage" part

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants