Always enable the login button (#24407)

The login button should always be enabled, to account for password managers that will auto-fill the form fields.
This commit is contained in:
Larry Gregory 2018-10-23 15:57:03 -04:00 committed by GitHub
parent 39bd2c8fce
commit b981546290
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -57,7 +57,6 @@ exports[`BasicLoginForm renders as expected 1`] = `
data-test-subj="loginSubmit"
fill={true}
iconSide="left"
isDisabled={true}
isLoading={false}
onClick={[Function]}
type="submit"

View file

@ -5,7 +5,7 @@
*/
import { EuiButton, EuiCallOut, EuiFieldText, EuiFormRow, EuiPanel, EuiSpacer } from '@elastic/eui';
import React, { ChangeEvent, Component, Fragment } from 'react';
import React, { ChangeEvent, Component, FormEvent, Fragment, MouseEvent } from 'react';
import { LoginState } from '../../../../../common/login_state';
interface Props {
@ -73,7 +73,6 @@ export class BasicLoginForm extends Component<Props, State> {
color="primary"
onClick={this.submit}
isLoading={this.state.isLoading}
isDisabled={!this.isFormValid()}
data-test-subj="loginSubmit"
>
Log in
@ -141,7 +140,9 @@ export class BasicLoginForm extends Component<Props, State> {
});
};
private submit = () => {
private submit = (e: MouseEvent<HTMLButtonElement> | FormEvent<HTMLFormElement>) => {
e.preventDefault();
if (!this.isFormValid()) {
return;
}