@@ -889,6 +889,7 @@ export class IgxSliderComponent implements
889
889
const adjustedValue = this . valueInRange ( value , this . lowerBound , this . upperBound ) ;
890
890
if ( this . _lowerValue !== adjustedValue ) {
891
891
this . _lowerValue = adjustedValue ;
892
+ this . lowerValueChange . emit ( this . _lowerValue ) ;
892
893
this . value = { lower : this . _lowerValue , upper : this . _upperValue } ;
893
894
}
894
895
}
@@ -927,6 +928,7 @@ export class IgxSliderComponent implements
927
928
const adjustedValue = this . valueInRange ( value , this . lowerBound , this . upperBound ) ;
928
929
if ( this . _upperValue !== adjustedValue ) {
929
930
this . _upperValue = adjustedValue ;
931
+ this . upperValueChange . emit ( this . _upperValue ) ;
930
932
this . value = { lower : this . _lowerValue , upper : this . _upperValue } ;
931
933
}
932
934
}
@@ -1122,28 +1124,26 @@ export class IgxSliderComponent implements
1122
1124
1123
1125
if ( this . isRange ) {
1124
1126
if ( thumbType === SliderHandle . FROM ) {
1125
- const newLower = this . lowerValue + value ;
1126
- if ( newLower >= this . lowerBound && newLower <= this . upperValue ) {
1127
- this . _lowerValue = newLower ;
1128
- this . lowerValueChange . emit ( this . _lowerValue ) ;
1127
+ if ( this . lowerValue + value > this . upperValue ) {
1128
+ this . upperValue = this . lowerValue + value ;
1129
1129
}
1130
+ this . lowerValue += value ;
1130
1131
} else {
1131
- const newUpper = this . upperValue + value ;
1132
- if ( newUpper <= this . upperBound && newUpper >= this . lowerValue ) {
1133
- this . _upperValue = newUpper ;
1134
- this . upperValueChange . emit ( this . _upperValue ) ;
1132
+ if ( this . upperValue + value < this . lowerValue ) {
1133
+ this . lowerValue = this . upperValue + value ;
1135
1134
}
1135
+ this . upperValue += value ;
1136
1136
}
1137
1137
1138
1138
const newVal : IRangeSliderValue = {
1139
- lower : this . _lowerValue ,
1140
- upper : this . _upperValue
1139
+ lower : this . lowerValue ,
1140
+ upper : this . upperValue
1141
1141
}
1142
1142
1143
1143
// Swap the thumbs if a collision appears.
1144
- if ( newVal . lower == newVal . upper ) {
1145
- this . toggleThumb ( ) ;
1146
- }
1144
+ // if (newVal.lower == newVal.upper) {
1145
+ // this.toggleThumb();
1146
+ // }
1147
1147
1148
1148
this . value = newVal ;
1149
1149
@@ -1235,11 +1235,11 @@ export class IgxSliderComponent implements
1235
1235
return this . _el . nativeElement . getBoundingClientRect ( ) . width / ( this . maxValue - this . minValue ) * this . step ;
1236
1236
}
1237
1237
1238
- private toggleThumb ( ) {
1239
- return this . thumbFrom . isActive ?
1240
- this . thumbTo . nativeElement . focus ( ) :
1241
- this . thumbFrom . nativeElement . focus ( ) ;
1242
- }
1238
+ // private toggleThumb() {
1239
+ // return this.thumbFrom.isActive ?
1240
+ // this.thumbTo.nativeElement.focus() :
1241
+ // this.thumbFrom.nativeElement.focus();
1242
+ // }
1243
1243
1244
1244
private valueInRange ( value , min = 0 , max = 100 ) {
1245
1245
return Math . max ( Math . min ( value , max ) , min ) ;
0 commit comments