diff --git a/ui/src/components/slider/slider-utils.js b/ui/src/components/slider/slider-utils.js index 15f40793f239..97dee945f932 100644 --- a/ui/src/components/slider/slider-utils.js +++ b/ui/src/components/slider/slider-utils.js @@ -245,9 +245,12 @@ export const SliderMixin = { }, innerBarStyle () { + const innerDiff = this.innerMaxRatio - this.innerMinRatio const acc = { [ this.positionProp ]: `${100 * this.innerMinRatio}%`, - [ this.sizeProp ]: `${100 * (this.innerMaxRatio - this.innerMinRatio)}%` + [this.sizeProp]: innerDiff === 0 + ? '2px' + : `${100 * innerDiff}%` } if (this.innerTrackImg !== void 0) { acc.backgroundImage = `url(${this.innerTrackImg}) !important` @@ -306,18 +309,16 @@ export const SliderMixin = { }, markerStyle () { - if (this.innerBarLen !== 0) { - const size = 100 * this.markerStep / this.innerBarLen - - return { - ...this.innerBarStyle, - backgroundSize: this.vertical === true - ? `2px ${size}%` - : `${size}% 2px` - } - } + const size = this.innerBarLen === 0 + ? 100 + : 100 * this.markerStep / this.innerBarLen - return null + return { + ...this.innerBarStyle, + backgroundSize: this.vertical === true + ? `2px ${size}%` + : `${size}% 2px` + } }, markerLabelsMap () {