Skip to content

Commit 0aab300

Browse files
authored
BarGauge: it should possible to show a tooltip after a resize during animation (T1242436) (DevExpress#28986)
1 parent 8055ffb commit 0aab300

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

packages/devextreme/js/viz/gauges/base_gauge.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ export const BaseGauge = BaseWidget.inherit({
8888
},
8989

9090
_cleanCore: function() {
91-
const that = this;
92-
that._tracker.deactivate();
93-
that._cleanContent();
91+
this._tracker.deactivate();
92+
this._noAnimation = false;
93+
this._cleanContent();
9494
},
9595

9696
_renderCore: function() {

packages/devextreme/testing/tests/DevExpress.viz.gauges/barGauge.tests.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,34 @@ QUnit.test('background is moved properly when container is resized', function(as
509509
});
510510
});
511511

512+
QUnit.test('_animateBars should be called after resize (animation enabled) (T1242436)', function(assert) {
513+
const gauge = this.$container.dxBarGauge({
514+
animation: true,
515+
size: { width: 200 },
516+
}).dxBarGauge('instance');
517+
const animateBarsSpy = sinon.spy(gauge, '_animateBars');
518+
const updateBarsSpy = sinon.spy(gauge, '_updateBars');
519+
520+
gauge.option('size.width', 300);
521+
522+
assert.strictEqual(animateBarsSpy.callCount, 1);
523+
assert.strictEqual(updateBarsSpy.callCount, 0);
524+
});
525+
526+
QUnit.test('_updateBars should be called after resize (animation disabled) (T1242436)', function(assert) {
527+
const gauge = this.$container.dxBarGauge({
528+
animation: false,
529+
size: { width: 200 },
530+
}).dxBarGauge('instance');
531+
const animateBarsSpy = sinon.spy(gauge, '_animateBars');
532+
const updateBarsSpy = sinon.spy(gauge, '_updateBars');
533+
534+
gauge.option('size.width', 300);
535+
536+
assert.strictEqual(animateBarsSpy.callCount, 0);
537+
assert.strictEqual(updateBarsSpy.callCount, 1);
538+
});
539+
512540
QUnit.test('Values are changed', function(assert) {
513541
const done = assert.async();
514542
const gauge = this.$container.dxBarGauge({

0 commit comments

Comments
 (0)