Skip to content

Commit 6ed607c

Browse files
committed
fix(dataZoom): handle NaN rect coords in positionGroup. close #21195
1 parent d0d53db commit 6ed607c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/component/dataZoom/SliderZoomView.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,11 @@ class SliderZoomView extends DataZoomView {
294294

295295
// Position barGroup
296296
const rect = thisGroup.getBoundingRect([sliderGroup]);
297-
thisGroup.x = location.x - rect.x;
298-
thisGroup.y = location.y - rect.y;
297+
const rectX = isNaN(rect.x) ? 0 : rect.x;
298+
const rectY = isNaN(rect.y) ? 0 : rect.y;
299+
300+
thisGroup.x = location.x - rectX;
301+
thisGroup.y = location.y - rectY;
299302
thisGroup.markRedraw();
300303
}
301304

0 commit comments

Comments
 (0)