Mirror: React hooks for accessible, common web interactions. UI super powers without the UI.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix useScrollRestoration id generation

+2 -4
+2 -4
src/useScrollRestoration.ts
··· 30 30 const scrollTarget = ref === 'window' ? document.body : ref.current!; 31 31 32 32 function restoreScroll(event?: PopStateEvent) { 33 - const id = `${addonId}${getIdForState( 34 - event ? event.state : history.state 35 - )}:${window.location}`; 33 + const id = addonId + getIdForState(event ? event.state : history.state); 36 34 const { scrollWidth, scrollHeight } = scrollTarget; 37 35 const scrollTo = scrollPositions[id]; 38 36 if (!scrollTo) { ··· 65 63 } 66 64 67 65 function onScroll() { 68 - const id = `${addonId}${getIdForState(history.state)}:${window.location}`; 66 + const id = addonId + getIdForState(history.state); 69 67 const scrollY = 70 68 ref === 'window' ? window.scrollY : ref.current!.scrollTop; 71 69 const scrollX =