Skip to content

Commit

Permalink
fix(slider): ensure track widths follow dynamic Spectrum CSS values
Browse files Browse the repository at this point in the history
  • Loading branch information
Westbrook committed Oct 28, 2019
1 parent 5a687ca commit 5ad1c1a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/slider/src/slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,10 @@ export class Slider extends Focusable {
}

private get trackRightStyle(): string {
const width = `width: ${(1 - this.trackProgress) * 100}%; `;
const offset = `left: calc(${this.trackProgress * 100}% + 8px)`;
const width = `width: ${(1 - this.trackProgress) * 100}%;`;
const halfHandleWidth = `var(--spectrum-slider-handle-width, var(--spectrum-global-dimension-size-200)) / 2`;
const offset = `left: calc(${this.trackProgress *
100}% + ${halfHandleWidth})`;

return width + offset;
}
Expand Down

0 comments on commit 5ad1c1a

Please sign in to comment.