[ci] format
This commit is contained in:
parent
49a4b28202
commit
2f95a3e0ca
2 changed files with 16 additions and 12 deletions
|
@ -41,11 +41,11 @@ const { fallback = 'animate' } = Astro.props as Props;
|
||||||
if (wait) return;
|
if (wait) return;
|
||||||
|
|
||||||
cb(...args);
|
cb(...args);
|
||||||
wait = true
|
wait = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
wait = false
|
wait = false;
|
||||||
}, delay);
|
}, delay);
|
||||||
}
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
async function getHTML(href: string) {
|
async function getHTML(href: string) {
|
||||||
|
@ -237,10 +237,14 @@ const { fallback = 'animate' } = Astro.props as Props;
|
||||||
addEventListener('load', onload);
|
addEventListener('load', onload);
|
||||||
// There's not a good way to record scroll position before a back button.
|
// There's not a good way to record scroll position before a back button.
|
||||||
// So the way we do it is by listening to scroll and just continuously recording it.
|
// So the way we do it is by listening to scroll and just continuously recording it.
|
||||||
addEventListener('scroll', throttle(() => {
|
addEventListener(
|
||||||
|
'scroll',
|
||||||
|
throttle(() => {
|
||||||
if (history.state) {
|
if (history.state) {
|
||||||
persistState({ ...history.state, scrollY })
|
persistState({ ...history.state, scrollY });
|
||||||
}
|
}
|
||||||
}, 300), { passive: true });
|
}, 300),
|
||||||
|
{ passive: true }
|
||||||
|
);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -235,7 +235,7 @@ test.describe('View Transitions', () => {
|
||||||
|
|
||||||
const newScrollY = await page.evaluate(() => window.scrollY);
|
const newScrollY = await page.evaluate(() => window.scrollY);
|
||||||
expect(oldScrollY).toEqual(newScrollY);
|
expect(oldScrollY).toEqual(newScrollY);
|
||||||
})
|
});
|
||||||
|
|
||||||
test('<Image /> component forwards transitions to the <img>', async ({ page, astro }) => {
|
test('<Image /> component forwards transitions to the <img>', async ({ page, astro }) => {
|
||||||
// Go to page 1
|
// Go to page 1
|
||||||
|
|
Loading…
Reference in a new issue