mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-25 06:30:00 +05:30
01.01.2018
This commit is contained in:
parent
7cb8dda4d3
commit
94217ff519
@ -113,7 +113,18 @@ class PanelTransition extends Component {
|
||||
return {
|
||||
auth: this.props.auth,
|
||||
user: this.props.user,
|
||||
requestRedraw: () => this.setState({isHeightDirty: true}, () => this.setState({isHeightDirty: false})),
|
||||
requestRedraw: () =>
|
||||
new Promise((resolve) =>
|
||||
this.setState(
|
||||
{isHeightDirty: true},
|
||||
() => {
|
||||
this.setState({isHeightDirty: false});
|
||||
|
||||
// wait till transition end
|
||||
setTimeout(resolve, 200);
|
||||
}
|
||||
)
|
||||
),
|
||||
clearErrors: this.props.clearErrors,
|
||||
resolve: this.props.resolve,
|
||||
reject: this.props.reject
|
||||
|
@ -82,9 +82,8 @@ export default class ForgotPasswordBody extends BaseAuthBody {
|
||||
this.setState({
|
||||
isLoginEdit: true
|
||||
});
|
||||
this.context.requestRedraw();
|
||||
// TODO: requestRedraw должен возвращать promise, по которому нужно ставить фокус на поле
|
||||
// иначе же, если фокус ставить сразу, то форма скачет
|
||||
setTimeout(() => {this.form.focus('login');}, 300);
|
||||
|
||||
this.context.requestRedraw()
|
||||
.then(() => this.form.focus('login'));
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user