oasis-wallet-web icon indicating copy to clipboard operation
oasis-wallet-web copied to clipboard

Replace click listeners on submit buttons with submit listeners on forms

Open lukaw3d opened this issue 1 year ago • 2 comments

Related to https://github.com/oasisprotocol/oasis-wallet-web/pull/1037#pullrequestreview-1124333939

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">

lukaw3d avatar Oct 05 '22 20:10 lukaw3d

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

alexander-elgin avatar Oct 08 '22 00:10 alexander-elgin

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

lukaw3d avatar Oct 11 '22 18:10 lukaw3d