T1329677 DataGrid - Column width changes are not applied immediately - #34818
Draft
nightskylark wants to merge 5 commits into
Draft
T1329677 DataGrid - Column width changes are not applied immediately#34818nightskylark wants to merge 5 commits into
nightskylark wants to merge 5 commits into
Conversation
…s changed via columnOption (T1329677)
…lumn resizing logic
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.
Fixes a
DataGridbug: whencolumnAutoWidthis enabled, changing a column'swidthviacolumnOption('field', 'width', N)at runtime is silently ignored — the column keeps its previously auto-fitted width until an explicitrepaint()/reinit()is triggered.Bug
columnAutoWidth's best-fit measurement pass caches the measured width into the column's internalvisibleWidthoption (m_grid_view.ts_setVisibleWidths).column.visibleWidth || column.width(m_columns_view.ts_columnOptionChanged).columnOption(field, 'width', N)call only updateswidth— the stalevisibleWidthis never invalidated, so the new width has no visible effect until a full repaint recomputes column state from scratch.Fix
packages/devextreme/js/__internal/grids/grid_core/columns_controller/m_columns_controller_utils.ts:isVisibleWidthChangePendingForColumnandinvalidateStaleVisibleWidthhelpers.columnOptionCorenow clears a stalecolumn.visibleWidthwheneverwidthis set explicitly, unless avisibleWidthchange for the same column is already pending in the current (not yet fired)_columnChangesbatch.The "pending batch" check preserves the drag-resize flow in
m_columns_resizing_reordering.ts(setColumnWidth's ratio-adapt branch), which intentionally setsvisibleWidthandwidthtogether in the same batch for instant visual feedback while dragging — that pairing must not be broken. External/API-driven calls (the reported bug, and the AI-assistantcolumnsResizeCommand) have no such pending pairing, so their stalevisibleWidthis correctly cleared.