Skip to content

Commit 9ca3757

Browse files
authored
TreeList - The W1025 warning occurs when dragging a row even if the component's height is specified. (T1280519) (#29404)
1 parent edfd1c2 commit 9ca3757

File tree

4 files changed

+33
-2
lines changed

4 files changed

+33
-2
lines changed

e2e/testcafe-devextreme/tests/treeList/rowDragging.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,27 @@ test('TreeList - Expand/collapse mechanism breaks after dragging action in the s
5959
},
6060
});
6161
});
62+
63+
[undefined, 200].forEach((height) => {
64+
test(`TreeList - The W1025 warning occurs when dragging a row (height: ${height ?? 'not set'}). (T1280519)`, async (t) => {
65+
const treeList = new TreeList('#container');
66+
67+
await treeList.isReady();
68+
69+
await treeList.moveRow(0, 10, 10, true);
70+
71+
const consoleMessages = await t.getBrowserConsoleMessages();
72+
const warningExists = !!consoleMessages?.warn.find((message) => message.startsWith('W1025'));
73+
74+
await t.expect(warningExists).eql(height === undefined);
75+
}).before(async () => createWidget('dxDataGrid', {
76+
height,
77+
scrolling: {
78+
mode: 'virtual',
79+
},
80+
dataSource: tasksT1228650,
81+
rowDragging: {
82+
allowReordering: true,
83+
},
84+
}));
85+
});

packages/devextreme/js/__internal/grids/grid_core/row_dragging/m_row_dragging.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ const rowsView = (Base: ModuleType<RowsView>) => class RowsViewRowDraggingExtend
105105
onDragStart: (e) => {
106106
// TODO getController
107107
this.getController('keyboardNavigation')?._resetFocusedCell();
108-
109108
const row = e.component.getVisibleRows()[e.fromIndex];
110109
e.itemData = row && row.data;
111110

@@ -212,6 +211,7 @@ const rowsView = (Base: ModuleType<RowsView>) => class RowsViewRowDraggingExtend
212211
fixed: column.fixed,
213212
fixedPosition: column.fixedPosition,
214213
})),
214+
isDragging: true,
215215
onRowPrepared: (e) => {
216216
const rowsView = e.component.getView('rowsView');
217217
$(e.rowElement).replaceWith($rowElement.eq(rowsView._isFixedTableRendering ? 1 : 0).clone());

packages/devextreme/js/__internal/grids/grid_core/virtual_scrolling/m_virtual_scrolling.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1788,10 +1788,15 @@ export const rowsView = (Base: ModuleType<RowsView>) => class VirtualScrollingRo
17881788
super.setLoading.call(this, isLoading, messageText);
17891789
}
17901790

1791+
private isGridDragging() {
1792+
return this.component.option('isDragging');
1793+
}
1794+
17911795
// NOTE: warning won't be thrown if height was specified and then removed,
17921796
// because for some reason `_hasHeight` is not updated properly in this case
17931797
private throwHeightWarningIfNeed() {
1794-
if (this._hasHeight === undefined) {
1798+
const isGridDragging = this.isGridDragging();
1799+
if (this._hasHeight === undefined || isGridDragging) {
17951800
return;
17961801
}
17971802

packages/devextreme/testing/tests/DevExpress.ui.widgets.dataGrid/rowDragging.tests.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ QUnit.module('Drag and Drop rows', moduleConfig, () => {
150150
pager: {
151151
visible: true
152152
},
153+
isDragging: true,
153154
scrolling: {
154155
useNative: true,
155156
showScrollbar: 'onScroll'
@@ -188,6 +189,7 @@ QUnit.module('Drag and Drop rows', moduleConfig, () => {
188189
fixedPosition: 'right'
189190
}
190191
],
192+
isDragging: true,
191193
columnAutoWidth: true,
192194
showColumnHeaders: false,
193195
showBorders: true,

0 commit comments

Comments
 (0)