diff --git a/packages/devextreme/js/__internal/grids/grid_core/sticky_columns/m_sticky_columns.ts b/packages/devextreme/js/__internal/grids/grid_core/sticky_columns/m_sticky_columns.ts index ba0d80c361c3..859d0bfe95bc 100644 --- a/packages/devextreme/js/__internal/grids/grid_core/sticky_columns/m_sticky_columns.ts +++ b/packages/devextreme/js/__internal/grids/grid_core/sticky_columns/m_sticky_columns.ts @@ -77,7 +77,13 @@ const baseStickyColumns = >(Base: T) => class rowIndex: number | null, ): void { const columnsController = this._columnsController; - const prevCellIsFixed = prevColumnIsFixed(columnsController, column, rowIndex); + const isRowsView = this.name === 'rowsView'; + const prevCellIsFixed = prevColumnIsFixed( + columnsController, + column, + rowIndex, + isRowsView, + ); const isFirstColumn = columnsController?.isFirstColumn(column, rowIndex); GridCoreStickyColumnsDom diff --git a/packages/devextreme/js/__internal/grids/grid_core/sticky_columns/utils.ts b/packages/devextreme/js/__internal/grids/grid_core/sticky_columns/utils.ts index 90577e5cb11d..5bf00fe868be 100644 --- a/packages/devextreme/js/__internal/grids/grid_core/sticky_columns/utils.ts +++ b/packages/devextreme/js/__internal/grids/grid_core/sticky_columns/utils.ts @@ -100,9 +100,10 @@ const getPrevColumn = function ( that: ColumnsController, column, visibleColumns, + rowIndex: number | null, // eslint-disable-next-line @typescript-eslint/no-explicit-any ): any { - const visibleColumnIndex = that.getVisibleIndex(column.index, 0); + const visibleColumnIndex = that.getVisibleIndex(column.index, rowIndex); return visibleColumns?.slice(0, visibleColumnIndex) .reverse() @@ -113,13 +114,15 @@ const prevColumnIsFixedCore = function ( that: ColumnsController, column, visibleColumns, + rowIndex: number | null, ): boolean { - const prevColumn = getPrevColumn(that, column, visibleColumns); + const prevColumn = getPrevColumn(that, column, visibleColumns, rowIndex); + const fixedPosition = getColumnFixedPosition(that, column); return !!prevColumn?.fixed && (!column.fixed - || column.fixedPosition === StickyPosition.Sticky - || column.fixedPosition !== prevColumn?.fixedPosition + || fixedPosition === StickyPosition.Sticky + || fixedPosition !== getColumnFixedPosition(that, prevColumn) ); }; @@ -195,18 +198,18 @@ export const prevColumnIsFixed = function ( rowIndex: number | null, isDataColumn = false, ): boolean { - const visibleColumns = that.getVisibleColumns(isDataColumn ? null : 0); + const visibleColumns = that.getVisibleColumns(isDataColumn ? null : rowIndex); const parentColumn = !isDataColumn && that.getParentColumn(column); if (parentColumn) { const isFirstColumn = that.isFirstColumn(column, rowIndex, true); if (isFirstColumn) { - return prevColumnIsFixedCore(that, parentColumn, visibleColumns); + return prevColumnIsFixedCore(that, parentColumn, that.getVisibleColumns(0), 0); } } - return prevColumnIsFixedCore(that, column, visibleColumns); + return prevColumnIsFixedCore(that, column, visibleColumns, rowIndex); }; export const normalizeOffset = function (offset: Record): CSSStyleDeclaration {