1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-22 22:16:13 -04:00

Revert "Fixed scrolling via jump list on series index"

This reverts commit 5d316ad7dc.
This commit is contained in:
ta264
2021-05-05 21:30:44 +01:00
committed by Mark McDowall
parent 519a5ca75c
commit 076ad5fe6d
4 changed files with 42 additions and 45 deletions
@@ -71,6 +71,7 @@ class SeriesIndexOverviews extends Component {
items,
sortKey,
overviewOptions,
jumpToCharacter,
isSmallScreen
} = this.props;
@@ -95,6 +96,18 @@ class SeriesIndexOverviews extends Component {
// recomputeGridSize also forces Grid to discard its cache of rendered cells
this._grid.recomputeGridSize();
}
if (jumpToCharacter != null && jumpToCharacter !== prevProps.jumpToCharacter) {
const index = getIndexOfFirstCharacter(items, jumpToCharacter);
if (this._grid && index != null) {
this._grid.scrollToCell({
rowIndex: index,
columnIndex: 0
});
}
}
}
//
@@ -188,7 +201,6 @@ class SeriesIndexOverviews extends Component {
const {
scroller,
items,
jumpToCharacter,
isSmallScreen
} = this.props;
@@ -210,24 +222,6 @@ class SeriesIndexOverviews extends Component {
return <div />;
}
let finalScrollTop = scrollTop;
if (jumpToCharacter != null) {
const index = getIndexOfFirstCharacter(items, jumpToCharacter);
if (index != null) {
if (index > 0) {
// Adjust 5px upwards so there is a gap between the bottom
// of the toolbar and top of the poster.
finalScrollTop = rowHeight * index - 5;
} else {
finalScrollTop = 0;
}
}
}
return (
<div ref={registerChild}>
<Grid
@@ -241,7 +235,7 @@ class SeriesIndexOverviews extends Component {
rowHeight={rowHeight}
width={width}
onScroll={onChildScroll}
scrollTop={finalScrollTop}
scrollTop={scrollTop}
overscanRowCount={2}
cellRenderer={this.cellRenderer}
scrollToAlignment={'start'}