Skip to content

Commit

Permalink
[ML] Fix single metric viewer chart resize. (#57578)
Browse files Browse the repository at this point in the history
Fix to trigger a chart update with the correct width when resizing the browser window. Previously after a browser refresh, or opening the view from a bookmarked URL, the chart would not resize until a state change was made to the view (such as moving the zoom slider or altering the time range).
  • Loading branch information
walterra authored Feb 14, 2020
1 parent 0adda9d commit cefe28c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ class TimeseriesChartIntl extends Component {
this.renderFocusChart();
}

componentDidUpdate() {
if (this.props.renderFocusChartOnly === false) {
componentDidUpdate(prevProps) {
if (this.props.renderFocusChartOnly === false || prevProps.svgWidth !== this.props.svgWidth) {
this.renderChart();
this.drawContextChartSelection();
}
Expand Down

0 comments on commit cefe28c

Please sign in to comment.