-
Notifications
You must be signed in to change notification settings - Fork 50k
Closed
Labels
Description
Do you want to request a feature or report a bug?
bug
What is the current behavior?
it is not currently possible to prevent form submission using the onSubmit handler
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
sample code at https://codesandbox.io/s/jpx80rj6vy
What is the expected behavior?
form should never submit because onSubmit returns false every time
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React 16
simplified code snippet below so you don't have to load the sandbox repro
<form onSubmit={() => false}>
<input type="text" name="bar" placeholder="type and hit enter" />
</form>
wzup, suwitinjinda and abel-slemmer