diff --git a/packages/devextreme/js/__internal/grids/grid_core/keyboard_navigation/m_keyboard_navigation.ts b/packages/devextreme/js/__internal/grids/grid_core/keyboard_navigation/m_keyboard_navigation.ts index c7aeb3dde3f9..7eba0da2e591 100644 --- a/packages/devextreme/js/__internal/grids/grid_core/keyboard_navigation/m_keyboard_navigation.ts +++ b/packages/devextreme/js/__internal/grids/grid_core/keyboard_navigation/m_keyboard_navigation.ts @@ -1743,7 +1743,7 @@ export class KeyboardNavigationController extends KeyboardNavigationControllerCo gridCoreUtils.focusAndSelectElement(this, $focusedElement); } - public _focus($cell, disableFocus?, skipFocusEvent?) { + public _focus($cell: dxElementWrapper, disableFocus?: boolean, skipFocusEvent?: boolean, preventScroll?: boolean) { const $row = $cell && !$cell.hasClass(ROW_CLASS) ? $cell.closest(`.${ROW_CLASS}`) : $cell; @@ -1795,8 +1795,12 @@ export class KeyboardNavigationController extends KeyboardNavigationControllerCo }); if (!skipFocusEvent) { this._applyTabIndexToElement($focusElement); - // @ts-expect-error - eventsEngine.trigger($focusElement, 'focus'); + if (preventScroll) { + $focusElement.get(0)?.focus({ preventScroll }); + } else { + // @ts-expect-error + eventsEngine.trigger($focusElement, 'focus'); + } } if (disableFocus) { $focusElement.addClass(CELL_FOCUS_DISABLED_CLASS); @@ -1809,7 +1813,7 @@ export class KeyboardNavigationController extends KeyboardNavigationControllerCo } } - public _updateFocus(isRenderView?, skipFocusEvent = false) { + public _updateFocus(isRenderView?: boolean, skipFocusEvent = false) { this._updateFocusTimeout = setTimeout(() => { if (this._needFocusEditingCell()) { this._editingController._focusEditingCell(); @@ -1848,12 +1852,12 @@ export class KeyboardNavigationController extends KeyboardNavigationControllerCo ); return; } - !isFocusedElementDefined && this._focus($cell, false, skipFocusEvent); + !isFocusedElementDefined && this._focus($cell, false, skipFocusEvent, !!isRenderView); } else if ( !isFocusedElementDefined && (this._isNeedFocus || this._isHiddenFocus) ) { - this._focus($cell, this._isHiddenFocus, skipFocusEvent); + this._focus($cell, this._isHiddenFocus, skipFocusEvent, !!isRenderView); } if (isEditing && !column?.showEditorAlways) { this._focusInteractiveElement.bind(this)($cell); diff --git a/packages/devextreme/js/__internal/grids/grid_core/keyboard_navigation/scrollable_a11y.ts b/packages/devextreme/js/__internal/grids/grid_core/keyboard_navigation/scrollable_a11y.ts index 0a7087cb9ede..b2f327fc28d8 100644 --- a/packages/devextreme/js/__internal/grids/grid_core/keyboard_navigation/scrollable_a11y.ts +++ b/packages/devextreme/js/__internal/grids/grid_core/keyboard_navigation/scrollable_a11y.ts @@ -61,8 +61,13 @@ export const keyboardNavigationScrollableA11yExtender = (Base: ModuleType {