Skip to content

Commit 9dbe155

Browse files
committed
set scrollpos selector to 0 for new path index
1 parent 07f57cf commit 9dbe155

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/redux/selectors/selectors.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ bool saveScrollPositionSelector(AppState state) =>
3737
(state != null) ? state.options.saveScrollPosition : false;
3838

3939
double getScrollOffsetForThisPath(Map<String, ScrollInfo> scrollPos, int id) {
40+
//set scroll position for path with does not exist previously in saved options.
41+
if (id > scrollPos.length) {
42+
scrollPos[id.toString()] = ScrollInfo(id, 0.0, 0.0);
43+
}
44+
4045
return scrollPos[id.toString()].scrollOffset;
4146
}
4247

0 commit comments

Comments
 (0)