Skip to content

Commit

Permalink
DataGrid - Gray boxes appear when the push method is used to remove r…
Browse files Browse the repository at this point in the history
…ows in infinite scrolling mode (T1240079) (DevExpress#28770)
  • Loading branch information
tongsonbarbs authored Jan 21, 2025
1 parent 6b3baab commit de303f7
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions e2e/testcafe-devextreme/tests/dataGrid/scrolling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1720,3 +1720,47 @@ test('The row alternation should display correctly when grouping and virtual scr
grouping: { autoExpandAll: true },
scrolling: { mode: 'virtual', useNative: false },
})));

test('DataGrid - Gray boxes appear when the push method is used to remove rows in infinite scrolling mode (T1240079)', async (t) => {
const dataGrid = new DataGrid('#container');
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const data = [
{ id: 1, text: 'text 1' },
{ id: 2, text: 'text 2' },
];
const changes = data.map((item) => ({
type: 'remove',
key: item.id,
}));

await dataGrid.apiPush(changes);
await t
.expect(await takeScreenshot('T1240079', dataGrid.element))
.ok()
.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
}).before(async () => {
await createWidget('dxDataGrid', () => {
const data = [
{ id: 1, text: 'text 1' },
{ id: 2, text: 'text 2' },
];
const dataSource = {
reshapeOnPush: true,
store: new (window as any).DevExpress.data.CustomStore({
key: 'id',
loadMode: 'raw',
load: () => Promise.resolve(data),
}),
};

return {
dataSource,
showBorders: true,
scrolling: {
mode: 'infinite',
},
height: 300,
};
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -1613,6 +1613,11 @@ export const rowsView = (Base: ModuleType<RowsView>) => class VirtualScrollingRo
.viewportItemSize(rowHeight);

if (isVirtualMode(this) || gridCoreUtils.isVirtualRowRendering(this)) {
const isEmptyRows = this._dataController.isEmpty();
if (isEmptyRows) {
return;
}

if (!isRender) {
this._updateContentItemSizes();
}
Expand Down

0 comments on commit de303f7

Please sign in to comment.