diff --git a/packages/calcite-components/src/components/slider/slider.stories.ts b/packages/calcite-components/src/components/slider/slider.stories.ts index b540259d980..2045cff0d84 100644 --- a/packages/calcite-components/src/components/slider/slider.stories.ts +++ b/packages/calcite-components/src/components/slider/slider.stories.ts @@ -452,15 +452,27 @@ export const fillPlacements = (): string => html`
+ + + +

+ + + +
+
+ + + `; export const customLabelsAndTicks = (): string => html` diff --git a/packages/calcite-components/src/components/slider/slider.tsx b/packages/calcite-components/src/components/slider/slider.tsx index ee4b0e85cf6..aa013772065 100644 --- a/packages/calcite-components/src/components/slider/slider.tsx +++ b/packages/calcite-components/src/components/slider/slider.tsx @@ -339,9 +339,17 @@ export class Slider
{this.tickValues.map((tick) => { const tickOffset = `${this.getUnitInterval(tick) * 100}%`; - let activeTicks = tick >= min && tick <= value; - if (useMinValue) { - activeTicks = tick >= this.minValue && tick <= this.maxValue; + + let activeTicks: boolean = false; + + if (fillPlacement === "start" || fillPlacement === "end") { + if (useMinValue) { + activeTicks = tick >= this.minValue && tick <= this.maxValue; + } else { + const rangeStart = fillPlacement === "start" ? min : value; + const rangeEnd = fillPlacement === "start" ? value : this.max; + activeTicks = tick >= rangeStart && tick <= rangeEnd; + } } return (