From 7fc8c1a9059eaeb43022264eafe3ca29aaf14f16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maren=20S=C3=BCwer?= Date: Fri, 11 Jan 2019 08:31:00 +0100 Subject: [PATCH] disable button after submit-method is triggered and rename state 'valid' to 'changed' as it does not check validity --- scm-ui/src/config/components/form/ConfigForm.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scm-ui/src/config/components/form/ConfigForm.js b/scm-ui/src/config/components/form/ConfigForm.js index 370925eee9..dc3f20c95d 100644 --- a/scm-ui/src/config/components/form/ConfigForm.js +++ b/scm-ui/src/config/components/form/ConfigForm.js @@ -24,7 +24,7 @@ type State = { loginAttemptLimitTimeout: boolean, loginAttemptLimit: boolean }, - valid: boolean + changed: boolean }; class ConfigForm extends React.Component { @@ -61,7 +61,7 @@ class ConfigForm extends React.Component { loginAttemptLimitTimeout: false, loginAttemptLimit: false }, - valid: false + changed: false }; } @@ -77,6 +77,9 @@ class ConfigForm extends React.Component { submit = (event: Event) => { event.preventDefault(); + this.setState({ + changed: false + }); this.props.submitForm(this.state.config); }; @@ -158,7 +161,9 @@ class ConfigForm extends React.Component { ); @@ -175,7 +180,7 @@ class ConfigForm extends React.Component { ...this.state.error, [name]: !isValid }, - valid: true + changed: true }); };