Skip to content

Commit b45f116

Browse files
committed
rangeslider: keep ref of input rangeslider container
- so that computed rangeslider range can be copied into input container, ensuring that the autorange routine isn't called on updates.
1 parent a9b83bb commit b45f116

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/components/rangeslider/defaults.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ var attributes = require('./attributes');
1515
module.exports = function handleDefaults(layoutIn, layoutOut, axName, counterAxes) {
1616
if(!layoutIn[axName].rangeslider) return;
1717

18-
var containerIn = Lib.isPlainObject(layoutIn[axName].rangeslider) ?
19-
layoutIn[axName].rangeslider : {},
18+
// not super proud of this (maybe store _ in axis object instead
19+
if(!Lib.isPlainObject(layoutIn[axName].rangeslider)) {
20+
layoutIn[axName].rangeslider = {};
21+
}
22+
23+
var containerIn = layoutIn[axName].rangeslider,
2024
containerOut = layoutOut[axName].rangeslider = {};
2125

2226
function coerce(attr, dflt) {
@@ -48,4 +52,7 @@ module.exports = function handleDefaults(layoutIn, layoutOut, axName, counterAxe
4852
layoutOut[ax] = opposing;
4953
});
5054
}
55+
56+
// to map back range slider (auto) range
57+
containerOut._input = containerIn;
5158
};

0 commit comments

Comments
 (0)