Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TreeList - The W1025 warning occurs when dragging a row even if the component's height is specified. (T1280519) #29337

Merged
merged 7 commits into from
Mar 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions e2e/testcafe-devextreme/tests/treeList/rowDragging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,27 @@ test('TreeList - Expand/collapse mechanism breaks after dragging action in the s
},
});
});

[undefined, 200].forEach((height) => {
test(`TreeList - The W1025 warning occurs when dragging a row (height: ${height ?? 'not set'}). (T1280519)`, async (t) => {
const treeList = new TreeList('#container');

await treeList.isReady();

await treeList.moveRow(0, 10, 10, true);

const consoleMessages = await t.getBrowserConsoleMessages();
const warningExists = !!consoleMessages?.warn.find((message) => message.startsWith('W1025'));

await t.expect(warningExists).eql(height === undefined);
}).before(async () => createWidget('dxDataGrid', {
height,
scrolling: {
mode: 'virtual',
},
dataSource: tasksT1228650,
rowDragging: {
allowReordering: true,
},
}));
});
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ const rowsView = (Base: ModuleType<RowsView>) => class RowsViewRowDraggingExtend
onDragStart: (e) => {
// TODO getController
this.getController('keyboardNavigation')?._resetFocusedCell();

const row = e.component.getVisibleRows()[e.fromIndex];
e.itemData = row?.data;

Expand Down Expand Up @@ -213,6 +212,7 @@ const rowsView = (Base: ModuleType<RowsView>) => class RowsViewRowDraggingExtend
fixed: column.fixed,
fixedPosition: column.fixedPosition,
})),
isDragging: true,
onRowPrepared: (e) => {
const rowsView = e.component.getView('rowsView');
$(e.rowElement).replaceWith($rowElement.eq(rowsView._isFixedTableRendering ? 1 : 0).clone());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1789,10 +1789,15 @@ export const rowsView = (Base: ModuleType<RowsView>) => class VirtualScrollingRo
super.setLoading.call(this, isLoading, messageText);
}

private isGridDragging() {
return this.component.option('isDragging');
}

// NOTE: warning won't be thrown if height was specified and then removed,
// because for some reason `_hasHeight` is not updated properly in this case
private throwHeightWarningIfNeed() {
if (this._hasHeight === undefined) {
const isGridDragging = this.isGridDragging();
if (this._hasHeight === undefined || isGridDragging) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ QUnit.module('Drag and Drop rows', moduleConfig, () => {
pager: {
visible: true
},
isDragging: true,
scrolling: {
useNative: true,
showScrollbar: 'onScroll'
Expand Down Expand Up @@ -190,6 +191,7 @@ QUnit.module('Drag and Drop rows', moduleConfig, () => {
fixedPosition: 'right'
}
],
isDragging: true,
columnAutoWidth: true,
showColumnHeaders: false,
showBorders: true,
Expand Down
Loading