From ebb1bb93cfc56aac1e6c84aa09549bf07d02ec80 Mon Sep 17 00:00:00 2001 From: Colin Megill Date: Mon, 4 Jun 2018 23:40:22 -0400 Subject: [PATCH] don't rerender continuous scale on responsive --- src/components/continuousLegend/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/continuousLegend/index.js b/src/components/continuousLegend/index.js index e3f6f14a..34b89161 100644 --- a/src/components/continuousLegend/index.js +++ b/src/components/continuousLegend/index.js @@ -103,7 +103,11 @@ class ContinuousLegend extends React.Component { this.state = {}; } componentWillReceiveProps(nextProps) { - if (nextProps.colorAccessor !== this.props.colorAccessor) { + if ( + nextProps.colorAccessor !== this.props.colorAccessor || + nextProps.responsive.height !== this.props.responsive.height || + nextProps.responsive.width !== this.props.responsive.width + ) { /* always remove it, if it's not continuous we don't put it back. */ d3 .select("#continuous_legend")