Dropdown menu is in open state when navigating back in browser

There is an odd behavior in IOS Safari of the dropdown menu with toggle.

When the dropdown contains links to other pages (tapping on it causes new page to load), then when the browsers back button is pressed, the previous page is being displayed with the dropdown menu fully expanded. This is not expected behavior.

When a link is pressed which leads to an anchor on the same page, and the back button is pressed, then the meu is collapsed, and this is the expected behavior.

I have not tested on Android mobile. This issue does not occur in Windows Chrome.

Please let me know how I can force the menu to collapse with some js code. This behavior is not looking good…

best regards,
Mikael

Hi Mikael,

Thank you for reaching out to us. I tried to check your site but it is currently under construction. You can try fixing it by adding the following code in the Theme Options > JS:

jQuery(document).ready(function($){
	if( $('.x-anchor-toggle').hasClass('x-active') ) {
		$('.x-anchor-toggle').click();
	}
});

Don’t forget to clear all caches including your browser’s cache after adding the code. If you still have problems kindly get back to us with the URL/User/Pass of your WordPress dashboard using the Secure Note functionality of the post to follow up the case.

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.