@@ -26,12 +26,12 @@ export class SliderWebcomponent extends BaseCustomWebComponentConstructorAppend
26
26
/* Remove Arrows/Spinners */
27
27
input::-webkit-outer-spin-button,
28
28
input::-webkit-inner-spin-button {
29
- -webkit- appearance: none;
29
+ appearance: none;
30
30
margin: 0;
31
31
}
32
32
33
33
.slider-container {
34
- width: 100%;
34
+ width: 100%;
35
35
}
36
36
37
37
.slider-container {
@@ -62,7 +62,7 @@ export class SliderWebcomponent extends BaseCustomWebComponentConstructorAppend
62
62
top: -8px;
63
63
pointer-events: none;
64
64
cursor: pointer;
65
- -webkit- appearance: none;
65
+ appearance: none;
66
66
}
67
67
68
68
/* Styles for the range thumb in WebKit browsers */
@@ -72,8 +72,17 @@ export class SliderWebcomponent extends BaseCustomWebComponentConstructorAppend
72
72
border-radius: 70%;
73
73
background: #555;
74
74
pointer-events: auto;
75
- -webkit- appearance: none;
75
+ appearance: none;
76
76
}
77
+
78
+ input[type="range"]::-moz-range-thumb {
79
+ height: 18px;
80
+ width: 18px;
81
+ border-radius: 70%;
82
+ background: #555;
83
+ pointer-events: auto;
84
+ appearance: none;
85
+ }
77
86
78
87
` ;
79
88
@@ -122,6 +131,7 @@ export class SliderWebcomponent extends BaseCustomWebComponentConstructorAppend
122
131
private _inputs : HTMLInputElement [ ] ;
123
132
private _rangeInputs : HTMLInputElement [ ] ;
124
133
private _ready : Boolean = false ;
134
+ private _valuesGap : number = 1 ;
125
135
126
136
public get valueMin ( ) {
127
137
return this . _valueMin ;
@@ -187,8 +197,6 @@ export class SliderWebcomponent extends BaseCustomWebComponentConstructorAppend
187
197
188
198
const rangevalue : HTMLDivElement = this . _getDomElement ( "slider" ) ;
189
199
190
- let valuesGap = 500 ;
191
-
192
200
for ( let i = 0 ; i < this . _inputs . length ; i ++ ) {
193
201
this . _inputs [ i ] . addEventListener ( "blur" , this . _handleInputChange . bind ( this ) ) ;
194
202
this . _inputs [ i ] . addEventListener ( "keydown" , ( e ) => {
@@ -207,13 +215,13 @@ export class SliderWebcomponent extends BaseCustomWebComponentConstructorAppend
207
215
let diff = maxVal - minVal ;
208
216
209
217
// Check if the values gap is exceeded
210
- if ( diff < valuesGap ) {
218
+ if ( diff < this . _valuesGap ) {
211
219
212
220
// Check if the input is the min range input
213
221
if ( ( e . target as HTMLInputElement ) . className === "min-range" ) {
214
- this . _rangeInputs [ 0 ] . value = ( maxVal - valuesGap ) . toString ( ) ;
222
+ this . _rangeInputs [ 0 ] . value = ( maxVal - this . _valuesGap ) . toString ( ) ;
215
223
} else {
216
- this . _rangeInputs [ 1 ] . value = ( minVal + valuesGap ) . toString ( ) ;
224
+ this . _rangeInputs [ 1 ] . value = ( minVal + this . _valuesGap ) . toString ( ) ;
217
225
}
218
226
} else {
219
227
@@ -257,13 +265,13 @@ export class SliderWebcomponent extends BaseCustomWebComponentConstructorAppend
257
265
let diff = maxp - minp ;
258
266
259
267
if ( minp < this . _min ) {
260
- alert ( `Minimum value cannot be less than ${ this . min . toString ( ) } ` ) ;
268
+ console . log ( `Minimum value cannot be less than ${ this . min . toString ( ) } ` ) ;
261
269
this . _inputs [ 0 ] . value = this . _min . toString ( ) ;
262
270
minp = 0 ;
263
271
}
264
272
265
273
if ( maxp > this . _max ) {
266
- alert ( `Maximum value cannot be greater than ${ this . max . toString ( ) } ` ) ;
274
+ console . log ( `Maximum value cannot be greater than ${ this . max . toString ( ) } ` )
267
275
this . _inputs [ 1 ] . value = this . _max . toString ( ) ;
268
276
maxp = this . _max ;
269
277
}
@@ -278,7 +286,7 @@ export class SliderWebcomponent extends BaseCustomWebComponentConstructorAppend
278
286
}
279
287
}
280
288
281
- if ( diff >= 500 && maxp <= parseInt ( this . _rangeInputs [ 1 ] . max ) ) {
289
+ if ( diff >= this . _valuesGap && maxp <= parseInt ( this . _rangeInputs [ 1 ] . max ) ) {
282
290
if ( inputIndex === 0 ) {
283
291
this . _rangeInputs [ 0 ] . value = minp . toString ( ) ;
284
292
let value1 = parseInt ( this . _rangeInputs [ 0 ] . max ) ;
0 commit comments