mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-25 06:30:00 +05:30
Fix form height was not re-calculcated when validation error changes
This commit is contained in:
parent
a69ae9d3c6
commit
99fc667a2b
@ -23,13 +23,15 @@ import { omit, debounce } from 'functions';
|
||||
* </MeasureHeight>
|
||||
*/
|
||||
|
||||
type ChildState = { [key: string]: any };
|
||||
|
||||
export default class MeasureHeight extends PureComponent<{
|
||||
shouldMeasure: (prevState: any, newState: any) => bool,
|
||||
onMeasure: (height: number) => void,
|
||||
state: any
|
||||
state: ChildState
|
||||
}> {
|
||||
static defaultProps = {
|
||||
shouldMeasure: (prevState: any, newState: any) => prevState !== newState,
|
||||
shouldMeasure: (prevState: ChildState, newState: ChildState) => prevState !== newState,
|
||||
onMeasure: (height: number) => {} // eslint-disable-line
|
||||
};
|
||||
|
||||
|
@ -339,8 +339,17 @@ class PanelTransition extends Component {
|
||||
}
|
||||
|
||||
shouldMeasureHeight() {
|
||||
const errorString = Object.values(this.props.auth.error || {})
|
||||
.reduce((acc, item) => {
|
||||
if (typeof item === 'string') {
|
||||
return acc + item;
|
||||
}
|
||||
|
||||
return acc + item.type;
|
||||
}, '');
|
||||
|
||||
return [
|
||||
this.props.auth.error,
|
||||
errorString,
|
||||
this.state.isHeightDirty,
|
||||
this.props.user.lang,
|
||||
this.props.accounts.available.length
|
||||
|
Loading…
Reference in New Issue
Block a user