Skip to content

Commit

Permalink
feat(libs/form-builder): go to next step only when no error
Browse files Browse the repository at this point in the history
  • Loading branch information
jb-coquet committed Mar 10, 2022
1 parent 7a4007c commit 2fcc670
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libs/form-builder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bedrockstreaming/form-builder",
"version": "0.8.3",
"main": "./src/index.ts",
"dependencies": {
"react-hook-form": "7.27.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ export function SubmitField({
const handleNextStep = React.useCallback(
(event) => {
event.preventDefault();
onNextStep(getValues());
if (!nextDisabled) {
onNextStep(getValues());
}
},
[onNextStep, getValues],
[onNextStep, getValues, nextDisabled],
);

return (
Expand Down
2 changes: 1 addition & 1 deletion libs/form-validation-rule-list/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bedrockstreaming/form-validation-rule-list",
"version": "0.8.3",
"main": "./src/index.ts",
"dependencies": {},
"peerDependencies": {
"react": "17.0.2",
Expand Down

0 comments on commit 2fcc670

Please sign in to comment.