mirror of
https://github.com/apache/superset.git
synced 2026-04-22 09:35:23 +00:00
Fix separator visualization by propagating header height (#4437)
This commit is contained in:
committed by
Maxime Beauchemin
parent
d6f1024d99
commit
0c87e23877
@@ -73,16 +73,21 @@ class GridCell extends React.PureComponent {
|
||||
|
||||
height(slice) {
|
||||
const widgetHeight = this.props.widgetHeight;
|
||||
const headerId = this.getHeaderId(slice);
|
||||
const headerHeight = this.headerHeight(slice);
|
||||
const descriptionId = this.getDescriptionId(slice);
|
||||
const headerHeight = this.refs[headerId] ? this.refs[headerId].offsetHeight : 30;
|
||||
let descriptionHeight = 0;
|
||||
if (this.props.isExpanded && this.refs[descriptionId]) {
|
||||
descriptionHeight = this.refs[descriptionId].offsetHeight + 10;
|
||||
}
|
||||
|
||||
return widgetHeight - headerHeight - descriptionHeight;
|
||||
}
|
||||
|
||||
headerHeight(slice) {
|
||||
const headerId = this.getHeaderId(slice);
|
||||
return this.refs[headerId] ? this.refs[headerId].offsetHeight : 30;
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
isExpanded, isLoading, isCached, cachedDttm,
|
||||
@@ -130,6 +135,7 @@ class GridCell extends React.PureComponent {
|
||||
chartKey={chartKey}
|
||||
datasource={datasource}
|
||||
formData={formData}
|
||||
headerHeight={this.headerHeight(slice)}
|
||||
height={this.height(slice)}
|
||||
width={this.width()}
|
||||
timeout={timeout}
|
||||
|
||||
Reference in New Issue
Block a user