Skip to content

Commit

Permalink
fix: do not call renderer for disconnected columns (#7389) (#7391)
Browse files Browse the repository at this point in the history
Co-authored-by: Serhii Kulykov <iamkulykov@gmail.com>
  • Loading branch information
vaadin-bot and web-padawan committed May 7, 2024
1 parent b5a6968 commit f020440
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 f020440

Please sign in to comment.