Get modal with embedded form working
This commit is contained in:
@@ -71,12 +71,7 @@ export class Login extends React.Component {
|
||||
}
|
||||
}
|
||||
}).catch((error) => {
|
||||
const elems = document.getElementsByName('email')
|
||||
if (elems) {
|
||||
elems[0].focus()
|
||||
}
|
||||
this.setState({
|
||||
binder: new FormBinder({ email: this.state.binder.getFieldValue('email').value }, Login.bindings),
|
||||
waitModal: false,
|
||||
messageModal: { icon: 'hold', message: `Unable to login`, detail: error.message }
|
||||
})
|
||||
@@ -85,7 +80,16 @@ export class Login extends React.Component {
|
||||
}
|
||||
|
||||
handleMessageModalDismiss() {
|
||||
this.setState({ messageModal: null })
|
||||
this.setState({
|
||||
messageModal: null,
|
||||
binder: new FormBinder({ email: this.state.binder.getFieldValue('email') }, Login.bindings)
|
||||
})
|
||||
|
||||
const elems = document.getElementsByName('password')
|
||||
|
||||
if (elems) {
|
||||
elems[0].focus()
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -93,9 +97,9 @@ export class Login extends React.Component {
|
||||
|
||||
return (
|
||||
<Row minHeight='100%'>
|
||||
<Row.Item grow> </Row.Item>
|
||||
<Row.Item grow />
|
||||
<Row.Item width='450px'>
|
||||
<form onSubmit={this.handleSubmit}>
|
||||
<form onSubmit={this.handleSubmit} id='loginForm'>
|
||||
<Column minHeight='100%'>
|
||||
<Column.Item>
|
||||
<Row>
|
||||
@@ -131,7 +135,7 @@ export class Login extends React.Component {
|
||||
<Row>
|
||||
<Row.Item grow />
|
||||
<Row.Item>
|
||||
<BoundButton name='submit' content='Login' submit binder={this.state.binder} />
|
||||
<BoundButton name='submit' content='Login' submit='loginForm' binder={this.state.binder} />
|
||||
</Row.Item>
|
||||
</Row>
|
||||
</Column.Item>
|
||||
@@ -144,7 +148,7 @@ export class Login extends React.Component {
|
||||
</Column>
|
||||
</form>
|
||||
</Row.Item>
|
||||
<Row.Item grow> </Row.Item>
|
||||
<Row.Item grow />
|
||||
|
||||
<WaitModal active={waitModal} message='Logging In' />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user