Skip to content

Commit 690f89f

Browse files
Slider: tooltip should update value when slider value is changed by keyboard (T1316215) (#32065)
Co-authored-by: Alexander Kozlovskiy <[email protected]>
1 parent 5dad59f commit 690f89f

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

packages/devextreme/js/__internal/ui/slider/m_slider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,7 @@ class Slider<
610610
} else {
611611
this.option('value', value);
612612
this._saveValueChangeEvent(undefined);
613+
this._actualValue = undefined;
613614
}
614615
}
615616

packages/devextreme/testing/tests/DevExpress.ui.widgets.editors/slider.tests.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,8 @@ module('tooltip integration', {
11811181

11821182
this.init = (options) => {
11831183
this.slider = this.$slider.dxSlider(options).dxSlider('instance');
1184+
this.$wrapper = this.$slider.find(`.${SLIDER_WRAPPER_CLASS}`);
1185+
this.pointer = pointerMock(this.$wrapper);
11841186
this.$handle = this.$slider.find(`.${SLIDER_HANDLE_CLASS}`);
11851187
this.handle = SliderHandle.getInstance(this.$handle);
11861188
this.$tooltip = this.$handle.find(`.${TOOLTIP_CLASS}`);
@@ -1351,6 +1353,24 @@ module('tooltip integration', {
13511353
this.checkTooltipExists(true, assert);
13521354
});
13531355

1356+
test('tooltip should update value when slider value is changed by keyboard after swipe event without swipeEnd (T1316215)', function(assert) {
1357+
this.init({
1358+
min: 0,
1359+
max: 100,
1360+
value: 50,
1361+
width: 100,
1362+
tooltip: {
1363+
enabled: true,
1364+
showMode: 'always'
1365+
}
1366+
});
1367+
1368+
this.pointer.start().swipeStart().swipe(0);
1369+
keyboardMock(this.$handle).keyDown('right');
1370+
1371+
assert.strictEqual(this.getTooltipText(), '51', 'tooltip value is updated');
1372+
});
1373+
13541374
module('tooltip position', () => {
13551375
test('tooltip should be centered after visibility changed', function(assert) {
13561376
const $parent = this.$slider.parent();

0 commit comments

Comments
 (0)