microsoft / fluentui-contrib

Monorepo for contributor extension packages to Fluent UI
MIT License
31 stars 35 forks source link

minor(react-data-grid-react-window-grid): bug fix on columnWidth not been called when rerendered #142

Closed FengQiMS closed 8 months ago

FengQiMS commented 8 months ago

Fix issue #141, There is cache from 'react-window' for performance improvement reason. here is the doc how to force update:

resetAfterColumnIndex(index: number, shouldForceUpdate: boolean = true): void VariableSizeGrid caches offsets and measurements for each column index for performance purposes. This method clears that cached data for all columns after (and including) the specified index. It should be called whenever a column's width changes. (Note that this is not a typical occurrance.)

By default the grid will automatically re-render after the index is reset. If you would like to delay this re-render until e.g. a state update has completed in the parent component, specify a value off false for the second, optional parameter.

Before fix the bug behaves: beforefixwidth After fix: afterfixwidth