mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
Fix: update chart when attached (#7758)
This commit is contained in:
parent
c749fbdf5f
commit
d5eaa12d96
@ -1010,8 +1010,8 @@ class Chart {
|
|||||||
const attached = () => {
|
const attached = () => {
|
||||||
_remove('attach', attached);
|
_remove('attach', attached);
|
||||||
|
|
||||||
me.resize();
|
|
||||||
me.attached = true;
|
me.attached = true;
|
||||||
|
me.resize();
|
||||||
|
|
||||||
_add('resize', listener);
|
_add('resize', listener);
|
||||||
_add('detach', detached);
|
_add('detach', detached);
|
||||||
|
|||||||
@ -637,6 +637,7 @@ describe('Chart', function() {
|
|||||||
dw: 0, dh: 0,
|
dw: 0, dh: 0,
|
||||||
rw: 0, rh: 0,
|
rw: 0, rh: 0,
|
||||||
});
|
});
|
||||||
|
expect(chart.chartArea).toBeUndefined();
|
||||||
|
|
||||||
waitForResize(chart, function() {
|
waitForResize(chart, function() {
|
||||||
expect(chart).toBeChartOfSize({
|
expect(chart).toBeChartOfSize({
|
||||||
@ -644,6 +645,8 @@ describe('Chart', function() {
|
|||||||
rw: 455, rh: 355,
|
rw: 455, rh: 355,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
expect(chart.chartArea).not.toBeUndefined();
|
||||||
|
|
||||||
body.removeChild(wrapper);
|
body.removeChild(wrapper);
|
||||||
chart.destroy();
|
chart.destroy();
|
||||||
done();
|
done();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user