sforkowany z mirror/soapbox
ScrollableList: clear scrollData useMemo if scrollKey changes
rodzic
36fb7fea7d
commit
8baa4cd262
|
@ -84,7 +84,7 @@ const ScrollableList = React.forwardRef<VirtuosoHandle, IScrollableList>(({
|
|||
|
||||
// Preserve scroll position
|
||||
const scrollDataKey = `soapbox:scrollData:${scrollKey}`;
|
||||
const scrollData: SavedScrollPosition | null = useMemo(() => JSON.parse(sessionStorage.getItem(scrollDataKey)!), []);
|
||||
const scrollData: SavedScrollPosition | null = useMemo(() => JSON.parse(sessionStorage.getItem(scrollDataKey)!), [scrollDataKey]);
|
||||
const topIndex = useRef<number>(scrollData ? scrollData.index : 0);
|
||||
const topOffset = useRef<number>(scrollData ? scrollData.offset : 0);
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue