Skip to content

Commit

Permalink
fix: do not call renderer for disconnected columns (#7389)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan authored and vaadin-bot committed May 7, 2024
1 parent b5a6968 commit f916e5b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/grid/src/vaadin-grid-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,9 @@ export const GridMixin = (superClass) =>
this._filterDragAndDrop(row, model);

iterateChildren(row, (cell) => {
if (cell._column && !cell._column.isConnected) {
return;
}
if (cell._renderer) {
const owner = cell._column || this;
cell._renderer.call(owner, cell._content, owner, model);
Expand Down
7 changes: 7 additions & 0 deletions packages/grid/test/tree-toggle.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ describe('tree toggle', () => {
expect(getBodyCellContent(grid, 0, 0).firstElementChild).to.equal(toggle);
});

it('should not throw when removing column and setting items', () => {
expect(() => {
grid.removeChild(column);
grid.items = [{ name: 'New name' }];
}).to.not.throw(Error);
});

describe('itemHasChildrenPath', () => {
beforeEach(() => {
sinon.stub(console, 'warn');
Expand Down

0 comments on commit f916e5b

Please sign in to comment.