diff --git a/packages/charts/src/vaadin-chart.js b/packages/charts/src/vaadin-chart.js index 4b43f6d7304..87dbb6bd260 100644 --- a/packages/charts/src/vaadin-chart.js +++ b/packages/charts/src/vaadin-chart.js @@ -1078,6 +1078,10 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) { disconnectedCallback() { super.disconnectedCallback(); + if (this.configuration) { + this._jsonConfigurationBuffer = this.configuration.userOptions; + } + queueMicrotask(() => { if (this.isConnected) { return; diff --git a/packages/charts/test/reattach.test.js b/packages/charts/test/reattach.test.js index 3d3e8ce7e02..a04ee5852d7 100644 --- a/packages/charts/test/reattach.test.js +++ b/packages/charts/test/reattach.test.js @@ -186,6 +186,20 @@ describe('reattach', () => { expect(chart.configuration.options.plotOptions.series.stacking).to.be.equal('percent'); }); + it('should restore configuration done through `updateConfigaration` after reattach', async () => { + const wrapper = fixtureSync(`