T1328904 - TreeList — Auto-width columns are incorrectly resized in Firefox#34190
Open
Tucchhaa wants to merge 3 commits into
Open
T1328904 - TreeList — Auto-width columns are incorrectly resized in Firefox#34190Tucchhaa wants to merge 3 commits into
Tucchhaa wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
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
expandedRowKeysvalue in the TreeList data source adapter and flag a newoperationTypes.nodeExpandingwhen it changes. - In TreeList’s data controller, translate
operationTypes.nodeExpandingintochange.needUpdateDimensionsso the view layer performs a full resize. - Refactor
ResizingController._refreshSizesto more clearly decide between lightweight row resize vs fullresize()based onneedUpdateDimensions.
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. |
Tucchhaa
commented
Jul 1, 2026
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); |
Contributor
Author
There was a problem hiding this comment.
refactoring only, no logic changes
Raushen
reviewed
Jul 1, 2026
|
|
||
| // T1328904 | ||
| test('columns should update auto width when expanding row', async (t) => { | ||
| const treeList = new TreeList('#container'); |
Contributor
There was a problem hiding this comment.
There is no treeList.isReady() check
Raushen
reviewed
Jul 1, 2026
|
|
||
| // T1328904 | ||
| test('columns should update auto width when collapsing row', async (t) => { | ||
| const treeList = new TreeList('#container'); |
Contributor
There was a problem hiding this comment.
There is no treeList.isReady() check
Raushen
reviewed
Jul 1, 2026
|
|
||
| // T1328904 | ||
| test('columns should update auto width when expanded row keys are updated using API', async (t) => { | ||
| const treeList = new TreeList('#container'); |
Contributor
There was a problem hiding this comment.
There is no treeList.isReady() check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.