I have a question about browser navigation after closing a portfolio lightbox.
Here is the procedure described in steps:
- I look at the main page on my website and then navigate to another page.- On this new page I click on an image which opens a lighbox portfolio.- Then I look through several images in that lightbox portfolio.- When I close the lightbox I am then back on the page from where I came to this lightbox.- But when I hit my browser's back button to go back to the main page of my site I notice that it still remains on the page where I was and that the address bar toggles through all the single lightbox images which I looked at until it eventualy and finally gets back to the main page where I expected to land with the first browser back click!
This is very unintuitive and makes many people think that the website navigation is somehow broken.
Is there anyway to fix this?
You dont need to look at my site to see this behaviour. This also happens for example in your own Kalium Photography demo site (I'M REMI). Just navigate through any of the lightboxes and then close that lightbox and you will see that you cannot go back to the previous page using your browsers back-button once. You have to click back through all the loaded addresses before you finally get back to where you want to be.
I understand your concern, I will assign this ticket to our developer and he will look more deeply into this and give you a proper answer. It may take more time than usual.
Documentation Join Kalium Users Group
No worries, Art.
I am happy to wait if a solution can be found.
I have addressed this issue and fixed it. In the next release it will be available:
Many thanks for your reply.
Looking at your link and animation I think there might be a misunderstanding:
My intention was as follows:
- Start on page 1.- Navigate from page 1 to page 2.- On page 2 open a lightbox and click through some images.- Close the lightbox and then I am naturally still on page 2.- Click the browser's back button and land back on page 1.
This is how all other lightboxes which I have seen on numerous websites work and that is what visitors to my site expect.
They way it functions now is as I have described before (see previous messages).
The way your animation shows it now is, if I have understood it right, as follows:After closing the lightbox on page 2 when I click my browser's back button the lightbox loads again and I go back through all the images just seen backwards until finally I land on page 1!!I just want to go directly back to page 1!! I have closed the lightbox with the intention of navigating back in my browser and going somewhere else.Why would I want to look through the lightbox images again backwards before finally getting to page 1??? I would just like to land back on page 1 and go from there.
Please let me know what you think.
Many thanks again.
Aha, I understand the point here. Really sorry because I thought what you said was implemented however I misunderstood the way of how this should work.
So this should be implemented with "replaceState" (a dev term) and not "pushState" which I am currently doing right now.
I have added this issue in our improvements todo list and will try to implement it in the next release.
When I finish it, I'll send you the file directly to let you use the fix sooner.
I have implemented this change, can you please try to replace the JS file in your site and see how it works for you:
Download this file, extract and replace the JS file in this directory (of the theme): /assets/js
If you don't see the change immediately, please hard-refresh your browser (CTRL/CMD+R) because it takes longer to load the changes, as they are saved in browser cache. Another option is to open new private/incognito window and try if it works.
Wonderful!The new JS file has done the trick and now navigation is as expected.
Many thanks for sorting this out so quickly. Much appreciated.
Happy to hear that this is now fixed, we will also include this fix in the next theme update
I wish you all the best.
Have a nice day!