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 { return {
auth: this.props.auth, auth: this.props.auth,
user: this.props.user, 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, clearErrors: this.props.clearErrors,
resolve: this.props.resolve, resolve: this.props.resolve,
reject: this.props.reject reject: this.props.reject

View File

@ -82,9 +82,8 @@ export default class ForgotPasswordBody extends BaseAuthBody {
this.setState({ this.setState({
isLoginEdit: true isLoginEdit: true
}); });
this.context.requestRedraw();
// TODO: requestRedraw должен возвращать promise, по которому нужно ставить фокус на поле this.context.requestRedraw()
// иначе же, если фокус ставить сразу, то форма скачет .then(() => this.form.focus('login'));
setTimeout(() => {this.form.focus('login');}, 300);
}; };
} }