Skip to content

Commit 2a7696a

Browse files
committed
rangeslider: inherit 'bgcolor' from 'plot_bgcolor'
1 parent b1155a3 commit 2a7696a

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/components/rangeslider/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports = function handleDefaults(layoutIn, layoutOut, axName, counterAxe
2727
return Lib.coerce(containerIn, containerOut, attributes, attr, dflt);
2828
}
2929

30-
coerce('bgcolor');
30+
coerce('bgcolor', layoutOut.plot_bgcolor);
3131
coerce('bordercolor');
3232
coerce('borderwidth');
3333
coerce('thickness');

test/jasmine/tests/range_slider_test.js

+20
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,26 @@ describe('the range slider', function() {
513513

514514
expect(layoutOut).toEqual(expected);
515515
});
516+
517+
it('should default \'bgcolor\' to layout \'plot_bgcolor\'', function() {
518+
var layoutIn = {
519+
xaxis: { rangeslider: true },
520+
yaxis: {},
521+
};
522+
523+
var layoutOut = {
524+
xaxis: { range: [2, 40]},
525+
yaxis: {},
526+
plot_bgcolor: 'blue'
527+
};
528+
529+
var axName = 'xaxis',
530+
counterAxes = ['yaxis'];
531+
532+
RangeSlider.handleDefaults(layoutIn, layoutOut, axName, counterAxes);
533+
534+
expect(layoutOut.xaxis.rangeslider.bgcolor).toEqual('blue');
535+
});
516536
});
517537

518538
describe('in general', function() {

0 commit comments

Comments
 (0)