Skip to content

Commit 9695f36

Browse files
author
Jack Biscupski
committed
ensure newRng stays in bounds
1 parent e778644 commit 9695f36

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/components/rangeslider/draw.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,15 @@ module.exports = function(gd) {
9999
];
100100
}
101101

102+
// make sure the slider's axis range (axRng) doesn't go above the
103+
// axis max or below the axis min (rng)
104+
if(axRng[1] > rng[1]) {
105+
newRng[1] = rng[1];
106+
}
107+
if(axRng[0] < rng[0]) {
108+
newRng[0] = rng[0];
109+
}
110+
102111
opts.range = opts._input.range = Lib.simpleMap(newRng, axisOpts.l2r);
103112
}
104113

0 commit comments

Comments
 (0)