-
Notifications
You must be signed in to change notification settings - Fork 665
DataGrid: Fix column reordering while using fixed columns (T1316881) #32252
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
base: 26_1
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a bug in DataGrid column reordering when using fixed columns with virtual column rendering mode (T1316881). The fix removes incorrect column index offset adjustments that were causing reordering to malfunction.
Changes:
- Removed column index offset logic from drag-and-drop column reordering operations
- Updated keyboard navigation to handle column index offset corrections after scrolling
- Refactored column visibility index calculations to handle virtual rendering mode properly
Reviewed changes
Copilot reviewed 9 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| m_headers_keyboard_navigation.ts | Added method to correct focused column index after scroll and simplified cell retrieval |
| m_column_keyboard_navigation_core.ts | Removed column index offset adjustments from visibility index calculations |
| m_columns_resizing_reordering.ts | Removed addColumnIndexOffset method and its usage from drag-and-drop operations |
| types.ts | Added type definitions for column index and drop location names |
| m_columns_controller_utils.ts | Refactored getColumnIndexByVisibleIndex to properly handle virtual rendering mode with column offsets |
| const.ts | Added constants for virtual command column and headers location |
| visual.ts | Added visual regression tests for column reordering scenarios |
| functional.ts | Added functional tests for column reordering with fixed columns and virtual rendering |
| columnReordering.ts | Moved existing tests to separate functional.ts and visual.ts files |
e2e/testcafe-devextreme/tests/dataGrid/common/columnReordering/functional.ts
Outdated
Show resolved
Hide resolved
8a6409c to
52a92fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 12 changed files in this pull request and generated 2 comments.
| visibleIndex = isObject(visibleIndex) ? visibleIndex.columnIndex : visibleIndex; | ||
| column = columns[visibleIndex]; | ||
| if (column?.type === GROUP_COMMAND_COLUMN_NAME) { | ||
| return that._columns.filter((col) => column.type === col.type)[0] || column; |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The filter condition compares column.type with col.type, but should compare the constant GROUP_COMMAND_COLUMN_NAME with col.type directly. The current logic will always match the first column with the same type, which might not be the intended behavior.
| return that._columns.filter((col) => column.type === col.type)[0] || column; | |
| return that._columns.filter((col) => col.type === GROUP_COMMAND_COLUMN_NAME)[0] || column; |
|
|
||
| return column?.index ?? -1; |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of optional chaining with nullish coalescing could mask issues where column is unexpectedly undefined. Consider using isDefined(column?.index) check consistent with the codebase pattern, or add explicit validation.
| return column?.index ?? -1; | |
| const columnIndex = column?.index; | |
| return isDefined(columnIndex) ? columnIndex : -1; |
No description provided.