diff --git a/shared/js/ui/elements/Slider.ts b/shared/js/ui/elements/Slider.ts index 669f2cf1..87238dd3 100644 --- a/shared/js/ui/elements/Slider.ts +++ b/shared/js/ui/elements/Slider.ts @@ -73,7 +73,7 @@ export function sliderfy(slider: JQuery, options?: SliderOptions) : Slider { const parent_offset = slider.offset(); const min = parent_offset.left; const max = parent_offset.left + slider.width(); - const current = 'touches' in event ? event.touches[event.touches.length - 1].clientX : event.pageX; + const current = ('touches' in event && Array.isArray(event.touches) && event.touches.length > 0) ? event.touches[event.touches.length - 1].clientX : (event as MouseEvent).pageX; const range = options.max_value - options.min_value; const offset = Math.round(((current - min) * (range / options.step)) / (max - min)) * options.step;