Skip to content

Commit ee7802c

Browse files
authored
DataGrid: Fix quick navigation with Ctrl+End when virtual and simulated scrolling is enabled (DevExpress#30190)
Co-authored-by: Alyar <>
1 parent 98ad42c commit ee7802c

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

packages/devextreme/js/__internal/grids/grid_core/keyboard_navigation/m_keyboard_navigation.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,17 @@ export class KeyboardNavigationController extends KeyboardNavigationControllerCo
267267
}
268268

269269
protected resizeCompleted(): void {
270-
if (this.needToRestoreFocus) {
270+
if (this.navigationToCellInProgress()) {
271+
this._resizeController.resetLastResizeTime(); // disable asynchronous resize
272+
}
273+
274+
if (!this.needToRestoreFocus) {
275+
return;
276+
}
277+
278+
const scrollLeft = this._rowsView?.getScrollable()?.scrollLeft() ?? 0;
279+
280+
if (!this._columnsController.isNeedToRenderVirtualColumns(scrollLeft)) {
271281
this.needToRestoreFocus = false;
272282
this.focusFirstOrLastCell();
273283
}
@@ -2636,7 +2646,7 @@ export class KeyboardNavigationController extends KeyboardNavigationControllerCo
26362646
return this._needNavigationToCell;
26372647
}
26382648

2639-
public needToSkipRenderingFocusState(): boolean {
2649+
public navigationToCellInProgress(): boolean {
26402650
return this.needToRestoreFocus || this.needNavigationToCell();
26412651
}
26422652
}
@@ -2678,7 +2688,7 @@ const rowsView = (Base: ModuleType<RowsView>) => class RowsViewKeyboardExtender
26782688
public renderFocusState(params) {
26792689
super.renderFocusState(params);
26802690

2681-
if (this._keyboardNavigationController.needToSkipRenderingFocusState()) {
2691+
if (this._keyboardNavigationController.navigationToCellInProgress()) {
26822692
return;
26832693
}
26842694

@@ -2820,7 +2830,6 @@ const rowsView = (Base: ModuleType<RowsView>) => class RowsViewKeyboardExtender
28202830
super._handleScroll(e);
28212831

28222832
if (this._keyboardNavigationController.needNavigationToCell()) {
2823-
this._resizeController.resetLastResizeTime();
28242833
this._keyboardNavigationController
28252834
.navigateToFirstOrLastCell(this._keyboardNavigationController.isQuickNavigationToFirstCell());
28262835
}

packages/devextreme/js/__internal/grids/grid_core/virtual_columns/m_virtual_columns.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ const rowsView = (Base: ModuleType<RowsView>) => class VirtualColumnsRowsViewExt
4242
const scrollable = this.getScrollable();
4343
let { left } = e.scrollOffset;
4444

45+
this._scrollLeft = left;
46+
4547
// @ts-expect-error
4648
super._handleScroll.apply(that, arguments);
4749

0 commit comments

Comments
 (0)