Skip to content

Commit

Permalink
fix: allow slider to show small increment changes (microsoft#5559)
Browse files Browse the repository at this point in the history
* fix: allow slider to show small increment changes

* Change files
  • Loading branch information
eljefe223 authored Feb 5, 2022
1 parent e00944d commit 5ed2935
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix: allow slider to show small increment changes",
"packageName": "@microsoft/fast-components",
"email": "jes@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix: allow slider to show small increment changes",
"packageName": "@microsoft/fast-foundation",
"email": "jes@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@ <h2>Negative positions</h2>
</fast-slider-label>
</fast-slider>

<!-- Large range small step -->
<h2>Large range with small step</h2>
<fast-slider min="0" max="1000" step="1" value="450" style="min-width: unset;">
<fast-slider-label hide-mark="true" position="0">
0
</fast-slider-label>
<fast-slider-label hide-mark="true" position="1000">
1000
</fast-slider-label>
</fast-slider>

<!-- Min above 0 -->
<h2>Min value greater than 0</h2>
<div style="width: 160px;">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ export class Slider extends FormAssociatedSlider implements SliderConfiguration
Number(this.max),
direction
);
const percentage: number = Math.round((1 - newPct) * 100);
const percentage: number = (1 - newPct) * 100;
if (this.orientation === Orientation.horizontal) {
this.position = this.isDragging
? `right: ${percentage}%; transition: none;`
Expand Down

0 comments on commit 5ed2935

Please sign in to comment.