Hi, I have a close button component as follows:
---
// TODO: Using ../ as a path for the close button works in production but not dev
// TODO: Using the close button does not restore scroll position when navigating backwards
interface Props {
path: string;
}
---
<a href={Astro.props.path} style="
position: fixed;
top: 0.4rem;
right: 0.4rem;
padding: 0.2rem;
background: #eee;
z-index: 5;
">Close</a>
However, as listed the close button has a few problems:
- It does not restore the scroll position of the page when the user goes back
- Using
../as the path attribute for the close button will navigate to the page in the parent directory of the current page for production mode, but not dev mode
How would I go about fixing these issues?