Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Commit

Permalink
Fix(useForm): exclude "button" type from form fields parser
Browse files Browse the repository at this point in the history
  • Loading branch information
wellyshen committed Jan 13, 2021
1 parent 63b605b commit 34b1eb5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/spotty-teachers-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-cool-form": patch
---

Fix(useForm): exclude "button" type from form fields parser
2 changes: 1 addition & 1 deletion src/useForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default <V extends FormValues = FormValues>({
dataset: { rcfIgnore },
} = field;

if (/image|submit|reset/.test(type)) return false;
if (/button|image|submit|reset/.test(type)) return false;
if (rcfIgnore && !name) {
warn('💡 react-cool-form > field: Missing the "name" attribute.');
return false;
Expand Down

0 comments on commit 34b1eb5

Please sign in to comment.