T1328904 - TreeList — Auto-width columns are incorrectly resized in Firefox#34190
T1328904 - TreeList — Auto-width columns are incorrectly resized in Firefox#34190Tucchhaa wants to merge 9 commits into
Conversation
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. |
| const currentExpandedKeys = this.option('expandedRowKeys'); | ||
|
|
||
| if (!equalByValue(this._lastExpandedRowKeys, currentExpandedKeys)) { | ||
| operationTypes.nodeExpanding = true; |
There was a problem hiding this comment.
I see there is not such type of operations. Can we reuse existing one? For example the reload type?
There was a problem hiding this comment.
Yes, that is a new type. I am not sure if we should reuse reload type, because:
- it may lead to some side effects (reload type is already used in several places)
- definition of
reloadoperation type is already very vague and overlaoded. I mean what's the difference between fullReload and reload, and why reload is true when specific operations are true
operationTypes.nodeExpanding has simple and concrete meaning on the other hand. So I suggest to keep it
What do you think?
There was a problem hiding this comment.
Ok, sounds fair. Anyway I'd suggest to include new type in the existing calculateOperationTypes so all types could be visible and calculated in one place. Can we move calculation there?
There was a problem hiding this comment.
operationTypes.nodeExpanding is used only in treelist (and not in datagrid), so I think moving to grid_core maybe confusing.
I suggest to move calculateOperationTypes from utils to member function of GridCore DataSourceAdapter and extend this method in TreeList's DataSourceAdapter.
Does it sound good to you?
No description provided.