Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const data = (Base: DataControllerBase) => class FocusDataControllerExtender ext
private changeRowExpand(path, isRowClick) {
// @ts-expect-error
if (this.option('focusedRowEnabled') && Array.isArray(path) && this.isRowExpanded(path)) {
if ((!isRowClick || !this._keyboardNavigationController.isKeyboardEnabled()) && this._isFocusedRowInsideGroup(path)) {
if ((!isRowClick || !this.keyboardNavigationController.isKeyboardEnabled()) && this._isFocusedRowInsideGroup(path)) {
this.option('focusedRowKey', path);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { isLocalStore } from '@ts/grids/grid_core/data_source_adapter/utils/stor
import type { EditingController } from '@ts/grids/grid_core/editing/m_editing';
import type { FilterSyncController } from '@ts/grids/grid_core/filter/m_filter_sync';
import type { FocusController } from '@ts/grids/grid_core/focus/m_focus';
import type { KeyboardNavigationController } from '@ts/grids/grid_core/keyboard_navigation/m_keyboard_navigation';
import modules from '@ts/grids/grid_core/m_modules';
import type {
Controllers, Module, OptionChanged, RowKey,
Expand Down Expand Up @@ -138,8 +137,6 @@ export class DataController extends DataHelperMixin(modules.Controller) {

private _filterExcludedColumn: Column | null = null;

protected _keyboardNavigationController!: KeyboardNavigationController;

protected _focusController!: FocusController;

private loadErrorHandlerProxy!: (e: Error | string) => void;
Expand All @@ -155,7 +152,6 @@ export class DataController extends DataHelperMixin(modules.Controller) {
this._adaptiveColumnsController = this.getController('adaptiveColumns');
this._editingController = this.getController('editing');
this._filterSyncController = this.getController('filterSync');
this._keyboardNavigationController = this.getController('keyboardNavigation');
this._focusController = this.getController('focus');

this._isPaging = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import type { ColumnHeadersView } from '@ts/grids/grid_core/column_headers/m_col
import type {
ColumnsResizerViewController,
} from '@ts/grids/grid_core/columns_resizing_reordering/m_columns_resizing_reordering';
import type { KeyboardNavigationController } from '@ts/grids/grid_core/keyboard_navigation/m_keyboard_navigation';
import type { ValidatingController } from '@ts/grids/grid_core/validating/m_validating';

import type { ColumnsController } from '../columns_controller/m_columns_controller';
Expand Down Expand Up @@ -76,8 +75,6 @@ export class EditorFactory extends ViewControllerWithMixin {

protected _columnsResizerController!: ColumnsResizerViewController;

protected _keyboardNavigationController!: KeyboardNavigationController;

protected _validatingController!: ValidatingController;

protected _columnHeadersView!: ColumnHeadersView;
Expand All @@ -90,7 +87,6 @@ export class EditorFactory extends ViewControllerWithMixin {

this._columnsResizerController = this.getController('columnsResizer');
this._editingController = this.getController('editing');
this._keyboardNavigationController = this.getController('keyboardNavigation');
this._columnsController = this.getController('columns');
this._validatingController = this.getController('validating');
this._columnHeadersView = this.getView('columnHeadersView');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,23 +498,32 @@ const keyboardNavigation = (Base: ModuleType<KeyboardNavigationController>) => c
}
};

const editorFactory = (Base: ModuleType<EditorFactory>) => class FocusEditorFactoryExtender extends Base {
const focusEditorFactoryViewControllerExtender = (
Base: ModuleType<EditorFactory>,
) => class FocusEditorFactoryExtender extends Base {
protected keyboardNavigationController!: KeyboardNavigationController;

public init(): void {
this.keyboardNavigationController = this.getController('keyboardNavigation');
super.init();
}

protected renderFocusOverlay($element, isHideBorder) {
const focusedRowEnabled = this.option('focusedRowEnabled');

if (
!focusedRowEnabled
|| !this._keyboardNavigationController?.isRowFocusType()
|| !this.keyboardNavigationController?.isRowFocusType()
|| this._editingController.isEditing()
|| this._columnHeadersView.isFilterRowCell($element)
) {
super.renderFocusOverlay($element, isHideBorder);
} else if (focusedRowEnabled) {
const isRowElement = this._keyboardNavigationController._getElementType($element) === 'row';
const isRowElement = this.keyboardNavigationController._getElementType($element) === 'row';

if (isRowElement && !$element.hasClass(ROW_FOCUSED_CLASS)) {
const $cell = this._keyboardNavigationController.getFirstValidCellInRow($element);
this._keyboardNavigationController.focus($cell);
const $cell = this.keyboardNavigationController.getFirstValidCellInRow($element);
this.keyboardNavigationController.focus($cell);
}
}
}
Expand Down Expand Up @@ -548,9 +557,18 @@ const columns = (Base: ModuleType<ColumnsController>) => class FocusColumnsExten
}
};

const data = (Base: ModuleType<DataController>) => class FocusDataControllerExtender extends Base {
const focusDataControllerExtender = (
Base: ModuleType<DataController>,
) => class FocusDataControllerExtender extends Base {
private _isDataPushed = false;

protected keyboardNavigationController!: KeyboardNavigationController;

public init(): void {
this.keyboardNavigationController = this.getController('keyboardNavigation');
super.init();
}

protected _applyChange(change) {
if (change && change.changeType === 'updateFocusedRow') return;

Expand Down Expand Up @@ -628,7 +646,7 @@ const data = (Base: ModuleType<DataController>) => class FocusDataControllerExte
const {
reload, fullReload, pageIndex, paging,
} = operationTypes;
const isVirtualScrolling = this._keyboardNavigationController._isVirtualScrolling();
const isVirtualScrolling = this.keyboardNavigationController._isVirtualScrolling();
const pagingWithoutVirtualScrolling = paging && !isVirtualScrolling;
const focusedRowKey = this.option('focusedRowKey');
const isAutoNavigate = this._focusController.isAutoNavigateToFocusedRow();
Expand Down Expand Up @@ -1044,11 +1062,11 @@ export const focusModule = {
controllers: {
keyboardNavigation,

editorFactory,
editorFactory: focusEditorFactoryViewControllerExtender,

columns,

data,
data: focusDataControllerExtender,

editing,
},
Expand Down
Loading