Skip to content

Commit e642666

Browse files
dmlvrpharret31
andauthored
T1328375 - Web Dashboard: "Uncaught TypeError: Cannot read properties of null (reading 'hide')" error is thrown on attempt to scroll above the Bar column (DevExpress#33689)
Signed-off-by: Dmitry Lavrinovich <52966626+dmlvr@users.noreply.github.com> Co-authored-by: Andrei Kharitonov <andrei.kharitonov@devexpress.com>
1 parent 205ef3a commit e642666

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

packages/devextreme/js/__internal/viz/sparklines/base_sparkline.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ const _disposeTooltip = BaseSparkline.prototype._disposeTooltip;
275275
BaseSparkline.prototype._disposeTooltip = function () {
276276
if (this._tooltip) {
277277
_disposeTooltip.apply(this, arguments);
278+
this._tooltipShown = false;
278279
}
279280
};
280281
BaseSparkline.prototype._setTooltipRendererOptions = function () {

packages/devextreme/testing/tests/DevExpress.viz.sparklines/baseSparklineTooltipEvents.tests.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,31 @@ QUnit.test('Tooltip should not hide if in the canvas with margins', function(ass
149149
assert.strictEqual(tooltipShown.callCount, 1);
150150
assert.strictEqual(tooltipHidden.callCount, 0);
151151
});
152+
153+
QUnit.test('No errors after dispose and manual _hideTooltip call (T1328375)', function(assert) {
154+
const bullet = this.createWidget({
155+
startScaleValue: 0,
156+
endScaleValue: 35,
157+
value: 20,
158+
tooltip: {
159+
enabled: true
160+
}
161+
});
162+
163+
const consoleErrorStub = sinon.stub(console, 'error');
164+
let caughtError;
165+
166+
bullet._showTooltip();
167+
bullet.dispose();
168+
169+
try {
170+
bullet._hideTooltip();
171+
} catch(error) {
172+
caughtError = error;
173+
} finally {
174+
consoleErrorStub.restore();
175+
}
176+
177+
assert.strictEqual(caughtError, undefined, '_hideTooltip should not throw after dispose');
178+
assert.strictEqual(consoleErrorStub.callCount, 0, 'console should not contain runtime errors');
179+
});

0 commit comments

Comments
 (0)