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

Fix useScrollRestoration id generation

Changed files
+2 -4
src
+2 -4
src/useScrollRestoration.ts
···
const scrollTarget = ref === 'window' ? document.body : ref.current!;
function restoreScroll(event?: PopStateEvent) {
-
const id = `${addonId}${getIdForState(
-
event ? event.state : history.state
-
)}:${window.location}`;
+
const id = addonId + getIdForState(event ? event.state : history.state);
const { scrollWidth, scrollHeight } = scrollTarget;
const scrollTo = scrollPositions[id];
if (!scrollTo) {
···
}
function onScroll() {
-
const id = `${addonId}${getIdForState(history.state)}:${window.location}`;
+
const id = addonId + getIdForState(history.state);
const scrollY =
ref === 'window' ? window.scrollY : ref.current!.scrollTop;
const scrollX =