mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 23:15:43 +01:00
move loading state for add user back to the submit button
This change is necessary, because the old loading behaviour forces the form to rerender, which in turn causes a lost of the input. Now the loading state is back to the submit button.
This commit is contained in:
@@ -9,6 +9,7 @@ import * as validator from "./userValidation";
|
||||
type Props = {
|
||||
submitForm: User => void,
|
||||
user?: User,
|
||||
loading?: boolean,
|
||||
t: string => string
|
||||
};
|
||||
|
||||
@@ -80,7 +81,7 @@ class UserForm extends React.Component<Props, State> {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { t } = this.props;
|
||||
const { loading, t } = this.props;
|
||||
const user = this.state.user;
|
||||
|
||||
let nameField = null;
|
||||
@@ -140,6 +141,7 @@ class UserForm extends React.Component<Props, State> {
|
||||
/>
|
||||
<SubmitButton
|
||||
disabled={!this.isValid()}
|
||||
loading={loading}
|
||||
label={t("user-form.submit")}
|
||||
/>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user