Skip to content
Draft
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
4 changes: 4 additions & 0 deletions packages/pluggableWidgets/datagrid-web/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Fixed

- We fixed an issue where clearing a grid would cause wrong column grid calculation, causing unwanted scroll bars.

## [3.8.1] - 2026-02-19

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ injected(DatasourceParamsController, CORE.setupService, DG.query, DG.combinedFil
injected(DatasourceService, CORE.setupService, DG.queryGate, DG.refreshInterval.optional);
injected(GridBasicData, CORE.mainGate);
injected(WidgetRootViewModel, CORE.mainGate, CORE.config, DG.exportProgressService, SA_TOKENS.selectionDialogVM);
injected(GridSizeStore, CORE.atoms.hasMoreItems, DG.paginationConfig, DG.setPageAction);
injected(GridSizeStore, CORE.atoms.hasMoreItems, CORE.atoms.itemCount, DG.paginationConfig, DG.setPageAction);

/** Pagination **/
injected(createSetPageAction, DG.query, DG.paginationConfig, DG.currentPage, DG.pageSize);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export class GridSizeStore {

constructor(
private readonly hasMoreItemsAtom: ComputedAtom<boolean | undefined>,
private readonly itemCountAtom: ComputedAtom<number>,
private readonly paginationConfig: PaginationConfig,
private readonly setPageAction: SetPageAction
) {
Expand Down Expand Up @@ -75,6 +76,15 @@ export class GridSizeStore {
}

updateColumnSizes(sizes: number[]): void {
const itemCount = this.itemCountAtom.get();

// If grid is empty, always clear columnSizes to use natural CSS grid layout
// This ensures empty grids behave consistently whether freshly rendered or emptied
if (itemCount === 0) {
this.columnSizes = undefined;
return;
}

this.columnSizes = sizes;
}

Expand Down
Loading