Fix: update chart when attached (#7758)

This commit is contained in:
Jukka Kurkela 2020-09-04 23:47:36 +03:00 committed by GitHub
parent c749fbdf5f
commit d5eaa12d96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -1010,8 +1010,8 @@ class Chart {
const attached = () => {
_remove('attach', attached);
me.resize();
me.attached = true;
me.resize();
_add('resize', listener);
_add('detach', detached);

View File

@ -637,6 +637,7 @@ describe('Chart', function() {
dw: 0, dh: 0,
rw: 0, rh: 0,
});
expect(chart.chartArea).toBeUndefined();
waitForResize(chart, function() {
expect(chart).toBeChartOfSize({
@ -644,6 +645,8 @@ describe('Chart', function() {
rw: 455, rh: 355,
});
expect(chart.chartArea).not.toBeUndefined();
body.removeChild(wrapper);
chart.destroy();
done();