01.01.2018

This commit is contained in:
SleepWalker 2018-01-01 19:00:38 +02:00
parent 7cb8dda4d3
commit 94217ff519
2 changed files with 15 additions and 5 deletions

View File

@ -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

View File

@ -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'));
};
}