You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When adding a component that contains a button (eg.: EtherInput) inside a <form>, when clicked it will submit the form.
Expected Behavior
The button should not submit the form, it should only behave how it's intended.
Steps To Reproduce
Create a form with onSubmit
Add EtherInput inside the form
Click on the button to swap between Ether and USD
It will submit the form
Anything else?
It's a very easy fix. We can simply explicitly add type="button" on all buttons and it will work just fine.
I can send a PR, if you agree this is the way to fix it. I would love to have this as my first contribution on the project.
The text was updated successfully, but these errors were encountered:
Thank you @melanke for reporting this and also for the steps to reproduce and a way to fix! I decided to fix it yourself since some components could be missed. Feel free to check the changes and review PR #992
For now it works only in the PR branch of scaffold-eth 2, but will be added to create-eth later
Is there an existing issue for this?
Which method was used to setup Scaffold-ETH 2 ?
npx create-eth@latest
Current Behavior
When adding a component that contains a button (eg.: EtherInput) inside a
<form>
, when clicked it will submit the form.Expected Behavior
The button should not submit the form, it should only behave how it's intended.
Steps To Reproduce
Anything else?
It's a very easy fix. We can simply explicitly add
type="button"
on all buttons and it will work just fine.I can send a PR, if you agree this is the way to fix it. I would love to have this as my first contribution on the project.
The text was updated successfully, but these errors were encountered: