File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -274,9 +274,12 @@ export default class extends Controller {
274274 this . scale . appendChild ( labelContainer ) ;
275275 labelContainer . style . width =
276276 i === this . values . range . length - 1 ? 0 : this . stepWidth + "px" ;
277+
277278 label . innerHTML = this . labelsValue
278279 ? this . formatStr ( this . values . range [ i ] )
279280 : "" ;
281+
282+ label . style . whiteSpace = "nowrap" ;
280283 label . style . marginLeft = ( label . clientWidth / 2 ) * - 1 + "px" ;
281284 }
282285 }
@@ -399,18 +402,18 @@ export default class extends Controller {
399402 move ( e ) {
400403 if ( ! this . activePointer ) return ;
401404
402- let coordX = e . pageX ;
405+ let coordX = e . touches ? e . touches [ 0 ] . pageX : e . pageX ;
403406 let index = coordX - this . sliderLeft - this . pointerWidth / 2 ;
404407
405408 index = Math . round ( index / this . stepWidth ) ;
406409 index = Math . max ( 0 , Math . min ( index , this . values . range . length - 1 ) ) ;
407410
408411 if ( this . isRange ) {
409412 if ( this . activePointer === this . pointerL ) {
410- this . values . start = index ;
413+ this . values . start = Math . min ( index , this . values . end ) ; ;
411414 }
412415 if ( this . activePointer === this . pointerR ) {
413- this . values . end = index ;
416+ this . values . end = Math . max ( index , this . values . start ) ;
414417 }
415418 } else {
416419 this . values . end = index ;
You can’t perform that action at this time.
0 commit comments