Recalculate grid in overview view when changing options

(cherry picked from commit d105dd47e02b9ed3616edf31d77623ca2ceb791e)

Closes #1656
pull/4068/head
Mark McDowall 4 years ago committed by Bogdan
parent f47e5084e8
commit fcd9fb592d

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

@ -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();
}

Loading…
Cancel
Save