From fee686e80ec8a08001104ca54fb1872955b742d8 Mon Sep 17 00:00:00 2001 From: "konstantin.kireyev" Date: Wed, 21 May 2025 14:47:52 +0500 Subject: [PATCH] fix bug 74566 --- apps/common/main/lib/component/Slider.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/common/main/lib/component/Slider.js b/apps/common/main/lib/component/Slider.js index 9376033ec6..fb56208664 100644 --- a/apps/common/main/lib/component/Slider.js +++ b/apps/common/main/lib/component/Slider.js @@ -226,7 +226,7 @@ define([ var onKeyUp = function (e) { if ( me.disabled ) return; -x + if (e.keyCode==Common.UI.Keys.UP || e.keyCode==Common.UI.Keys.DOWN || Common.UI.Keys.LEFT || Common.UI.Keys.RIGHT) { e.stopPropagation(); e.preventDefault(); @@ -242,6 +242,7 @@ x el.on('mousedown', '.thumb', onMouseDown); el.on('mousedown', '.track', onTrackMouseDown); if (this.options.enableKeyEvents) { + me.input = el.find('input'); el.on('keydown', 'input', onKeyDown); el.on('keyup', 'input', onKeyUp); } @@ -262,8 +263,11 @@ x }, setThumbPosition: function (pos) { - const isVertical = this.direction === 'vertical'; + if (typeof pos !== 'number' || Number.isNaN(pos)) { + pos = 0; + } + const isVertical = this.direction === 'vertical'; const trackSize = isVertical ? this.track.height() : this.track.width(); const offset = pos / 100 * trackSize + this.thumbRange[pos];