Skip to content

Commit b3f34ee

Browse files
spike
1 parent dd2a1fb commit b3f34ee

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,8 @@ export class KeyboardNavigationController extends KeyboardNavigationControllerCo
312312
if (needUpdateFocus) {
313313
const isScrollEvent = !!e?.event?.type;
314314
const skipFocusEvent = e?.virtualColumnsScrolling && isScrollEvent;
315-
this._updateFocus(true, skipFocusEvent);
315+
const preventScroll = !isFullUpdate;
316+
this._updateFocus(true, skipFocusEvent, preventScroll);
316317
}
317318
}
318319
}
@@ -1631,7 +1632,7 @@ export class KeyboardNavigationController extends KeyboardNavigationControllerCo
16311632
gridCoreUtils.focusAndSelectElement(this, $focusedElement);
16321633
}
16331634

1634-
public _focus($cell, disableFocus?, skipFocusEvent?) {
1635+
public _focus($cell, disableFocus?, skipFocusEvent?, preventScroll = false) {
16351636
const $row = $cell && !$cell.hasClass(ROW_CLASS)
16361637
? $cell.closest(`.${ROW_CLASS}`)
16371638
: $cell;
@@ -1683,8 +1684,7 @@ export class KeyboardNavigationController extends KeyboardNavigationControllerCo
16831684
});
16841685
if (!skipFocusEvent) {
16851686
this._applyTabIndexToElement($focusElement);
1686-
// @ts-expect-error
1687-
eventsEngine.trigger($focusElement, 'focus');
1687+
$focusElement.get(0)?.focus({ preventScroll });
16881688
}
16891689
if (disableFocus) {
16901690
$focusElement.addClass(CELL_FOCUS_DISABLED_CLASS);
@@ -1697,7 +1697,7 @@ export class KeyboardNavigationController extends KeyboardNavigationControllerCo
16971697
}
16981698
}
16991699

1700-
public _updateFocus(isRenderView?, skipFocusEvent = false) {
1700+
public _updateFocus(isRenderView?, skipFocusEvent = false, preventScroll = false) {
17011701
this._updateFocusTimeout = setTimeout(() => {
17021702
if (this._needFocusEditingCell()) {
17031703
this._editingController._focusEditingCell();
@@ -1741,7 +1741,7 @@ export class KeyboardNavigationController extends KeyboardNavigationControllerCo
17411741
!isFocusedElementDefined
17421742
&& (this._isNeedFocus || this._isHiddenFocus)
17431743
) {
1744-
this._focus($cell, this._isHiddenFocus, skipFocusEvent);
1744+
this._focus($cell, this._isHiddenFocus, skipFocusEvent, preventScroll);
17451745
}
17461746
if (isEditing && !column?.showEditorAlways) {
17471747
this._focusInteractiveElement.bind(this)($cell);

0 commit comments

Comments
 (0)