mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-28 16:00:24 +05:30
#22: Fix height jumps in Collapsed
This commit is contained in:
parent
e2e43e6e8f
commit
08cf6d38b8
@ -34,12 +34,11 @@ export default class Collapse extends Component<Props, {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
// TODO: @SleepWalker сейчас при первой отрисовке можно увидеть дёргание родительского блока. Надо пофиксить.
|
|
||||||
const { isOpened, children, onRest } = this.props;
|
const { isOpened, children, onRest } = this.props;
|
||||||
const { height, wasInitialized } = this.state;
|
const { height, wasInitialized } = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.overflow}>
|
<div className={styles.overflow} style={wasInitialized ? {} : { height: 0 }}>
|
||||||
<MeasureHeight
|
<MeasureHeight
|
||||||
state={this.shouldMeasureHeight()}
|
state={this.shouldMeasureHeight()}
|
||||||
onMeasure={this.onUpdateHeight}
|
onMeasure={this.onUpdateHeight}
|
||||||
@ -56,7 +55,6 @@ export default class Collapse extends Component<Props, {
|
|||||||
style={{
|
style={{
|
||||||
marginTop: top,
|
marginTop: top,
|
||||||
visibility: wasInitialized ? 'inherit' : 'hidden',
|
visibility: wasInitialized ? 'inherit' : 'hidden',
|
||||||
// height: wasInitialized ? 'auto' : 0,
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
Loading…
Reference in New Issue
Block a user