react-submittable icon indicating copy to clipboard operation
react-submittable copied to clipboard

Button's in forms cause double submits onEnter

Open mcwhittemore opened this issue 10 years ago • 0 comments

Because a button's default type is submit and a form will trigger a submit on enter, giving a button inside of <Submittable> an onSubmit callback that is the same as a the required onEnter callback will cause double submit.

This can be prevented by invoking event.preventDefault() inside of the callback, but we might want to look at preventing inside of react-submittable as this seems unexpected.

mcwhittemore avatar Nov 10 '15 17:11 mcwhittemore