diff --git a/src/vaadin-grid.js b/src/vaadin-grid.js index 4085291d3..15e1609bf 100644 --- a/src/vaadin-grid.js +++ b/src/vaadin-grid.js @@ -508,7 +508,9 @@ class GridElement extends ElementMixin( } if (this._columnTree) { - this._columnTree[this._columnTree.length - 1].forEach((c) => c.notifyPath && c.notifyPath('_cells.*', c._cells)); + this._columnTree[this._columnTree.length - 1].forEach( + (c) => c.isConnected && c.notifyPath && c.notifyPath('_cells.*', c._cells) + ); } beforeNextRender(this, () => { diff --git a/test/column.test.js b/test/column.test.js index 770687dc3..44303ae9e 100644 --- a/test/column.test.js +++ b/test/column.test.js @@ -552,4 +552,13 @@ describe('column', () => { expect(column._bodyTemplate).to.eql(template2); }); }); + + it('should not throw an exception when size is changed after removing column', () => { + expect(grid.size).to.equal(10); + expect(column.isConnected).to.be.true; + column.remove(); + expect(column.isConnected).to.be.false; + expect(() => (grid.size = 11)).not.to.throw(); + expect(grid.size).to.equal(11); + }); });