diff --git a/src/vaadin-grid-column.html b/src/vaadin-grid-column.html index 27464f046..759a9c597 100644 --- a/src/vaadin-grid-column.html +++ b/src/vaadin-grid-column.html @@ -313,6 +313,10 @@ /** @private */ __setColumnTemplateOrRenderer(template, renderer, cells) { + // no renderer or template needed in a hidden column + if (this.hidden) { + return; + } if (template && renderer) { throw new Error('You should only use either a renderer or a template'); } diff --git a/test/column.html b/test/column.html index 37942a39e..9e0924149 100644 --- a/test/column.html +++ b/test/column.html @@ -207,6 +207,12 @@ const details = grid.shadowRoot.querySelector('#items [part~="details-cell"]')._content; expect(details.textContent).to.equal('row-details'); }); + + it('should not throw error when adding a new row with a hidden column', () => { + column.hidden = true; + flushGrid(grid); + expect(() => (grid.size = 11)).to.not.throw(Error); + }); }); describe('path', () => {