Recalculate grid in overview view when changing options

(cherry picked from commit d105dd47e02b9ed3616edf31d77623ca2ceb791e)

Closes #1656
This commit is contained in:
Mark McDowall 2020-10-05 21:15:49 -07:00 committed by Bogdan
parent f47e5084e8
commit fcd9fb592d
2 changed files with 9 additions and 5 deletions

View File

@ -15,7 +15,6 @@ const rows = [
name: 'monitored',
showProp: 'showMonitored',
valueProp: 'monitored'
},
{
name: 'qualityProfileId',

View File

@ -73,7 +73,8 @@ class ArtistIndexOverviews extends Component {
sortKey,
overviewOptions,
jumpToCharacter,
scrollTop
scrollTop,
isSmallScreen
} = this.props;
const {
@ -84,13 +85,17 @@ class ArtistIndexOverviews extends Component {
if (prevProps.sortKey !== sortKey ||
prevProps.overviewOptions !== overviewOptions) {
this.calculateGrid();
this.calculateGrid(this.state.width, isSmallScreen);
}
if (this._grid &&
if (
this._grid &&
(prevState.width !== width ||
prevState.rowHeight !== rowHeight ||
hasDifferentItemsOrOrder(prevProps.items, items))) {
hasDifferentItemsOrOrder(prevProps.items, items) ||
prevProps.overviewOptions !== overviewOptions
)
) {
// recomputeGridSize also forces Grid to discard its cache of rendered cells
this._grid.recomputeGridSize();
}