Skip to content

Commit

Permalink
Fix case when columnHidingEnabled = false and columns have hidingPrio…
Browse files Browse the repository at this point in the history
…rity
  • Loading branch information
Alyar committed Oct 8, 2024
1 parent 271680a commit 6732cf6
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,40 @@ fixture.disablePageReloads`Sticky columns - Adaptability`

column.hidingPriority = index;
column.width = 200;

return column;
});
},
columnHidingEnabled: true,
}));
});

safeSizeTest('Sticky columns with sticky positions when columnHidingEnabled = false and columns have hidingPriority', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const dataGrid = new DataGrid(DATA_GRID_SELECTOR);

await takeScreenshot('adaptability_sticky_columns_with_sticky_positions_and_hiding_priority_1.png', dataGrid.element);

await dataGrid.scrollTo(t, { x: 10000 });

await takeScreenshot('adaptability_sticky_columns_with_sticky_positions_and_hiding_priority_2.png', dataGrid.element);

await t
.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
}, [900, 800]).before(async () => createWidget('dxDataGrid', {
...defaultConfig,
width: 800,
customizeColumns(columns) {
columns.forEach((column, index) => {
if (index === 1 || index === 4) {
column.fixed = true;
column.fixedPosition = 'sticky';
} else {
column.fixed = false;
}

column.hidingPriority = index;
column.width = 200;
});
},
columnHidingEnabled: false,
}));
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,15 @@ const baseStickyColumns = <T extends ModuleType<ColumnsView>>(Base: T) => class

protected _resizeCore() {
const isStickyColumns = this._isStickyColumns();
const columnHidingEnabled = this.option('columnHidingEnabled');
const adaptiveColumns = this.getController('adaptiveColumns');
const hidingColumnsQueue = adaptiveColumns?.getHidingColumnsQueue();

super._resizeCore.apply(this, arguments as any);

if (isStickyColumns) {
this.setStickyOffsets();

if (columnHidingEnabled) {
if (hidingColumnsQueue?.length) {
this._updateBorderClasses();
}
}
Expand Down

0 comments on commit 6732cf6

Please sign in to comment.