Skip to content

Commit

Permalink
Chart: Prevent stopping the current handling after dispose (T1200461)
Browse files Browse the repository at this point in the history
  • Loading branch information
marker-dao authored Dec 11, 2023
1 parent 3987f34 commit 90df312
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js/__internal/viz/chart_components/m_base_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1392,6 +1392,9 @@ export const BaseChart = BaseWidget.inherit({
},

_stopCurrentHandling() {
if (this._disposed) {
return;
}
this._tracker.stopCurrentHandling();
},
});
Expand Down
18 changes: 18 additions & 0 deletions testing/tests/DevExpress.viz.charts/chartSync.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1613,6 +1613,24 @@ const environment = {
}
});

QUnit.test('There is no error when _stopCurrentHandling is called after dispose (T1200461)', function(assert) {
chartMocks.seriesMockData.series.push(new MockSeries({ points: getPoints(10) }));

const chart = this.createChart({
series: [{ type: 'line' }]
});

this.$container.remove();

try {
chart._stopCurrentHandling({});

assert.ok(true, 'should be no exceptions');
} catch(e) {
assert.ok(false, 'Exception rised');
}
});

// T1063025
QUnit.test('mousedown handling when chart disposed', function(assert) {
$(domAdapter.getDocument()).on('dxpointerdown', () => {
Expand Down

0 comments on commit 90df312

Please sign in to comment.