From fe9f85033837c2d7603bbcd61cff69d63789cf9a Mon Sep 17 00:00:00 2001 From: Jernej Pregelj Date: Tue, 5 Mar 2019 10:10:22 +0100 Subject: [PATCH] disable next button on clearing form --- src/routes/Publish/index.tsx | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/routes/Publish/index.tsx b/src/routes/Publish/index.tsx index 162d422..f93b5a5 100644 --- a/src/routes/Publish/index.tsx +++ b/src/routes/Publish/index.tsx @@ -169,6 +169,16 @@ class Publish extends Component<{}, PublishState> { } } })) + } else { + this.setState(prevState => ({ + validationStatus: { + ...prevState.validationStatus, + 1: { + ...prevState.validationStatus[1], + allFieldsValid: false + } + } + })) } // @@ -184,6 +194,16 @@ class Publish extends Component<{}, PublishState> { } } })) + } else { + this.setState(prevState => ({ + validationStatus: { + ...prevState.validationStatus, + 2: { + ...prevState.validationStatus[2], + allFieldsValid: false + } + } + })) } // @@ -203,6 +223,16 @@ class Publish extends Component<{}, PublishState> { } } })) + } else { + this.setState(prevState => ({ + validationStatus: { + ...prevState.validationStatus, + 3: { + ...prevState.validationStatus[3], + allFieldsValid: false + } + } + })) } }