Skip to content

T1328904 - TreeList — Auto-width columns are incorrectly resized in Firefox#34190

Open
Tucchhaa wants to merge 3 commits into
DevExpress:26_1from
Tucchhaa:firefox_autowidth_26_1
Open

T1328904 - TreeList — Auto-width columns are incorrectly resized in Firefox#34190
Tucchhaa wants to merge 3 commits into
DevExpress:26_1from
Tucchhaa:firefox_autowidth_26_1

Conversation

@Tucchhaa

@Tucchhaa Tucchhaa commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@Tucchhaa Tucchhaa self-assigned this Jul 1, 2026
@Tucchhaa Tucchhaa added the 26_1 label Jul 1, 2026
Copilot AI review requested due to automatic review settings July 1, 2026 12:04
@Tucchhaa Tucchhaa requested a review from a team as a code owner July 1, 2026 12:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes TreeList layout recalculation so that columnAutoWidth columns are properly resized (notably in Firefox) when nodes are expanded/collapsed, by forcing a full dimension update for that specific operation.

Changes:

  • Track the last expandedRowKeys value in the TreeList data source adapter and flag a new operationTypes.nodeExpanding when it changes.
  • In TreeList’s data controller, translate operationTypes.nodeExpanding into change.needUpdateDimensions so the view layer performs a full resize.
  • Refactor ResizingController._refreshSizes to more clearly decide between lightweight row resize vs full resize() based on needUpdateDimensions.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/devextreme/js/__internal/grids/tree_list/data_source_adapter/m_data_source_adapter.ts Detects changes in expandedRowKeys and marks a dedicated operation type (nodeExpanding).
packages/devextreme/js/__internal/grids/tree_list/data_controller/m_data_controller.ts Forces needUpdateDimensions on update cycles triggered by node expanding/collapsing.
packages/devextreme/js/__internal/grids/grid_core/views/m_grid_view.ts Ensures update refresh logic triggers full resize when needUpdateDimensions is requested.

Copilot AI review requested due to automatic review settings July 1, 2026 13:59
Comment on lines 174 to +213
private _refreshSizes(e) {
// @ts-expect-error
let resizeDeferred = new Deferred<null>().resolve(null);
const changeType = e?.changeType;
const isDelayed = e?.isDelayed;
const items = this._dataController.items();

if (!e || changeType === 'refresh' || changeType === 'prepend' || changeType === 'append') {
if (!e || ['refresh', 'prepend', 'append'].includes(changeType)) {
if (!isDelayed) {
resizeDeferred = this.resize();
return this.resize();
}
} else if (changeType === 'update') {
if (e.changeTypes?.length === 0) {
return resizeDeferred;
}

if (changeType === 'update') {
if (!e.changeTypes?.length) {
// @ts-expect-error
return new Deferred<null>().resolve(null);
}
if ((items.length > 1 || e.changeTypes[0] !== 'insert')
&& !(items.length === 0 && e.changeTypes[0] === 'remove') && !e.needUpdateDimensions) {

const items = this._dataController.items();
const isHidingNoDataPanel = items.length <= 1 && e.changeTypes[0] === 'insert';
const isShowingNoDataPanel = items.length === 0 && e.changeTypes[0] === 'remove';

if (!isHidingNoDataPanel && !isShowingNoDataPanel && !e.needUpdateDimensions) {
// @ts-expect-error
resizeDeferred = new Deferred();
const deferred = new Deferred();

this._waitAsyncTemplates().done(() => {
deferUpdate(() => deferRender(() => deferUpdate(() => {
this._setScrollerSpacing();
this._rowsView.resize();
resizeDeferred.resolve();
deferred.resolve();
})));
}).fail(resizeDeferred.reject);
} else {
resizeDeferred = this.resize();
}).fail(deferred.reject);

return deferred;
}

return this.resize();
}

return resizeDeferred;
// @ts-expect-error
return new Deferred<null>().resolve(null);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactoring only, no logic changes


// T1328904
test('columns should update auto width when expanding row', async (t) => {
const treeList = new TreeList('#container');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no treeList.isReady() check


// T1328904
test('columns should update auto width when collapsing row', async (t) => {
const treeList = new TreeList('#container');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no treeList.isReady() check


// T1328904
test('columns should update auto width when expanded row keys are updated using API', async (t) => {
const treeList = new TreeList('#container');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no treeList.isReady() check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants