Closed jspaaks closed 1 year ago
Maybe related: F5 refresh does not reset the state to all zeros
Seems solvable by pushing the URL including search parameters with the most recent state onto history onbeforeunload
, something like in pages/software/v0.1/index.page.vue
, within the onMounted()
:
window.onbeforeunload = () => {
const preserve = [
window.location.origin,
window.location.pathname,
`?${fairQueryParams.value}`
].join('');
window.history.pushState({}, '', preserve);
};
Not sure it's good practice though, might lead to unexpected behavior when the user clicks goes back and forth through history.
Closing for now, haven't seen any problems with this of late.
Bug: I can sometimes select two radio buttons in one question. It seems to be related to going to GitHub or another site and clicking Back. This happens on desktop + Arch Linux + Edge. Reproduce with:
Also happens in the software route, also happens on desktop + Ubuntu + Firefox
update: the reproduce method doesn't work reliably