-
Notifications
You must be signed in to change notification settings - Fork 665
DataGrid: prevent column resizing in band area (T1317039) #32263
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?
DataGrid: prevent column resizing in band area (T1317039) #32263
Conversation
cec3960 to
1251a32
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
This PR fixes an issue where DataGrid columns could be resized from the band header area, which should not be allowed. The fix adds Y-coordinate checking to the column resizing logic to ensure resizing only occurs when the mouse is positioned within the actual resizable column header row, not in the band header area above it.
Changes:
- Modified the
_getTargetPointmethod to accept aCoordinatesobject (with both x and y) instead of just x coordinate, and added logic to check if the mouse Y position is at or below the top of the resizable column header - Added proper null safety checks for
_targetPointthroughout the codebase to handle cases where it may now be null when the mouse is in the band area - Created a new
functional.tstest file for functional column resizing tests and moved the existing visual test case, while adding a new test case specifically for the band area resizing prevention
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/devextreme/js/__internal/grids/grid_core/m_types.ts |
Added new Coordinates interface to represent x and y coordinate pairs |
packages/devextreme/js/__internal/grids/grid_core/columns_resizing_reordering/m_columns_resizing_reordering.ts |
Updated _getTargetPoint to accept Coordinates object and check Y coordinate; added null safety in _setupResizingInfo; improved type annotations; refactored pointsByColumns method |
packages/devextreme/js/__internal/grids/grid_core/column_fixing/m_column_fixing.ts |
Updated overridden _getTargetPoint method signature to match base class changes |
packages/devextreme/js/__internal/grids/grid_core/filter/m_filter_row.ts |
Added null safety checks with optional chaining for _targetPoint accesses |
packages/devextreme/testing/tests/DevExpress.ui.widgets.dataGrid/columnFixing.tests.js |
Updated QUnit test calls to pass Coordinates object instead of just x coordinate |
e2e/testcafe-devextreme/tests/dataGrid/common/columnResizing/visual.ts |
Updated import paths and removed one test case (moved to functional.ts) |
e2e/testcafe-devextreme/tests/dataGrid/common/columnResizing/functional.ts |
New file containing functional tests for column resizing, including the moved test and a new test case for band area resizing prevention (T1317039) |
9a9e265 to
77d6a6c
Compare
77d6a6c to
e40c9d5
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 7 out of 16 changed files in this pull request and generated 2 comments.
| if (pointsByColumns) { | ||
| for (let i = 0; i < pointsByColumns.length; i++) { | ||
| if (pointsByColumns[i].x === pointsByColumns[0].x && pointsByColumns[i + 1] && pointsByColumns[i].x === pointsByColumns[i + 1].x) { | ||
| for (let i = 0; i < pointsByColumns.length; i += 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.
Incrementing with i += 1 is unnecessarily verbose. Use the standard i++ increment operator for consistency with JavaScript conventions.
| for (let i = 0; i < pointsByColumns.length; i += 1) { | |
| for (let i = 0; i < pointsByColumns.length; i++) { |
| }; | ||
|
|
||
| // T1317039 | ||
| test('DataGrid – Columns should not be resized from band area (T1317039)', async (t) => { |
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.
This test validates the Y-coordinate restriction when resizing from the band area, but there should also be a test verifying that normal column resizing (within valid Y bounds) still works correctly after this change.
No description provided.