Y
Hacker News
new
|
ask
|
show
|
jobs
by
calibas
2841 days ago
What about just removing what you can't see from the DOM entirely, and load it in again when the dialog closes? Wouldn't be too hard with React or Vue. Just make it so either the page content or the modal is loaded.
2 comments
TekMol
2841 days ago
Or just throw in a CSS rule that says 'Everything not in the modal is display: none'. You don't need React or Vue for that. Just a line of CSS.
link
DerJacques
2841 days ago
You can do that, but the visitor's scroll position would be reset, when the modal is closed.
link
calibas
2841 days ago
Could save it and restore it, though that may create some other issues.
link