DataGrid - decompose _getNextCell method in keyboard navigation controller#32755
Open
dmirgaev wants to merge 3 commits intoDevExpress:26_1from
Open
DataGrid - decompose _getNextCell method in keyboard navigation controller#32755dmirgaev wants to merge 3 commits intoDevExpress:26_1from
dmirgaev wants to merge 3 commits intoDevExpress:26_1from
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors DataGrid keyboard navigation by decomposing the _getNextCell logic into smaller helper methods and tightening TypeScript typings for navigation-related parameters.
Changes:
- Introduced extended keyboard navigation direction and element type aliases in
types.ts. - Refactored
_getNextCellinto_adjustCellOnVerticalNav,_resolveInvalidCell, and_getNextCellSkippingHiddenRowhelpers. - Minor TypeScript type style cleanup in keyboard navigation integration tests.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/devextreme/js/__internal/grids/grid_core/keyboard_navigation/types.ts | Adds shared type aliases for extended navigation directions and element types. |
| packages/devextreme/js/__internal/grids/grid_core/keyboard_navigation/m_keyboard_navigation.ts | Decomposes _getNextCell and adds stricter typing around navigation params/return values. |
| packages/devextreme/js/__internal/grids/grid_core/keyboard_navigation/tests/keyboard_navigation.integration.test.ts | Adjusts generic type syntax style in it.each cases (no behavior change). |
Comments suppressed due to low confidence (1)
packages/devextreme/js/__internal/grids/grid_core/keyboard_navigation/m_keyboard_navigation.ts:1705
- $cell is now typed as
dxElementWrapper | null, but it’s used immediately via$cell.parent()without a null-guard. In the base controller_getFocusedCell()always returns a wrapper ($(...)), so the nullable type (and the subsequent$cell &&check) is misleading. Either keep$cellasdxElementWrapper(preferred) or add an early return/guard before any$cell.*usage ifnullis actually possible.
let $cell: dxElementWrapper | null = this._getFocusedCell();
const isEditing = this._editingController.isEditing();
if (!this.getMasterDetailCell($cell) || this._isRowEditMode()) {
if (this._hasSkipRow($cell.parent())) {
packages/devextreme/js/__internal/grids/grid_core/keyboard_navigation/m_keyboard_navigation.ts
Outdated
Show resolved
Hide resolved
packages/devextreme/js/__internal/grids/grid_core/keyboard_navigation/m_keyboard_navigation.ts
Outdated
Show resolved
Hide resolved
packages/devextreme/js/__internal/grids/grid_core/keyboard_navigation/m_keyboard_navigation.ts
Outdated
Show resolved
Hide resolved
packages/devextreme/js/__internal/grids/grid_core/keyboard_navigation/m_keyboard_navigation.ts
Outdated
Show resolved
Hide resolved
packages/devextreme/js/__internal/grids/grid_core/keyboard_navigation/types.ts
Outdated
Show resolved
Hide resolved
bcc8492 to
bedcddb
Compare
anna-shakhova
approved these changes
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.