So I have a modal, I have noticed if a user clicks their browser “back button” after viewing the modal if will lock up the site and have it greyed out as it thinks the modal is still in focus.
Is there a way to hide a modal if a user changes pages?
Example of what I’m talking about: If you click “View More Details” and then click your browser back button. http://164.92.75.108/boats
Based on your findings I tried the same on my site where I show a modal after a search action. when pressing the back button on the browser the same thing happens as on your website.
But I do not like this method, for it means that all pages in the project must contain the on-load or on-ready event.
I think, a better way would be to have a Router component that allows the modal to close beforeRouteLeave or similar. That way you would need it only for the page containing the modal.