File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -205,7 +205,9 @@ export class MdSlider implements AfterContentInit {
205
205
206
206
// This calculation finds the closest step by finding the closest whole number divisible by the
207
207
// step relative to the min.
208
- this . value = Math . round ( ( exactValue - this . min ) / this . step ) * this . step + this . min ;
208
+ let closestValue = Math . round ( ( exactValue - this . min ) / this . step ) * this . step + this . min ;
209
+ // The value needs to snap to the min and max.
210
+ this . value = this . clamp ( closestValue , this . min , this . max ) ;
209
211
this . _renderer . updateThumbAndFillPosition ( this . _percent , this . _sliderDimensions . width ) ;
210
212
}
211
213
Original file line number Diff line number Diff line change @@ -23,5 +23,6 @@ <h1>Slider with set value</h1>
23
23
24
24
< h1 > Slider with step defined</ h1 >
25
25
< section class ="demo-section ">
26
- < md-slider step ="25 "> </ md-slider >
26
+ < md-slider min ="1 " max ="100 " step ="20 " #slider5 > </ md-slider >
27
+ {{slider5.value}}
27
28
</ section >
You can’t perform that action at this time.
0 commit comments