Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenLYZ committed Jun 9, 2022
1 parent 806ac54 commit be7b680
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,14 @@ export default class Chart extends React.Component {
}

getHeaderHeight() {
const marginBottom = parseInt(
getComputedStyle(this.headerRef).getPropertyValue('margin-bottom'),
);
return this.headerRef
? this.headerRef.offsetHeight + Number.isNaN(marginBottom)
? 0
: marginBottom
: DEFAULT_HEADER_HEIGHT;
if (this.headerRef) {
const computedStyle = getComputedStyle(this.headerRef).getPropertyValue(
'margin-bottom',
);
const marginBottom = parseInt(computedStyle, 10) || 0;
return this.headerRef.offsetHeight + marginBottom;
}
return DEFAULT_HEADER_HEIGHT;
}

setDescriptionRef(ref) {
Expand Down

0 comments on commit be7b680

Please sign in to comment.