Fix separator visualization by propagating header height (#4437)

This commit is contained in:
Jay Lindquist
2018-02-15 19:48:57 -06:00
committed by Maxime Beauchemin
parent d6f1024d99
commit 0c87e23877
3 changed files with 22 additions and 3 deletions

View File

@@ -20,6 +20,7 @@ const propTypes = {
containerId: PropTypes.string.isRequired,
datasource: PropTypes.object.isRequired,
formData: PropTypes.object.isRequired,
headerHeight: PropTypes.number,
height: PropTypes.number,
width: PropTypes.number,
setControlValue: PropTypes.func,
@@ -63,6 +64,7 @@ class Chart extends React.PureComponent {
this.getFilters = this.getFilters.bind(this);
this.clearFilter = this.clearFilter.bind(this);
this.removeFilter = this.removeFilter.bind(this);
this.headerHeight = this.headerHeight.bind(this);
this.height = this.height.bind(this);
this.width = this.width.bind(this);
}
@@ -129,6 +131,10 @@ class Chart extends React.PureComponent {
return this.props.width || this.container.el.offsetWidth;
}
headerHeight() {
return this.props.headerHeight || 0;
}
height() {
return this.props.height || this.container.el.offsetHeight;
}