You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 7, 2020. It is now read-only.
From my research the onpageshow event works as a cache event, but not on first-load (not sure if this is problematic or not). Apple's bfcache of Safari on iOS will not cache framed pages, however, and from their own documentation suggest adding a blank iframe:
Safaris Back/Forward cache (the cache pulled from when a visitor presses the Back or Forward browser buttons) can also be thwarted by insuring that your page contains a frame. Frame-based pages are never stored in the back / forward cache and you can insure your non-frame based page behaves similarly by adding the invisible iframe below.
<iframe style="height:0px;width:0px;visibility:hidden" src="about:blank">
this frame prevents back forward cache
</iframe>
I'm not sure I like the idea of injecting and empty frame into the DOM, however, so onpageshow might be the best option. However, you'd still likely get a flash of the open nav before it closed (due to the caching).
It might be worth considering if this is really an issue, though — technically, returning to the last screen with the nav open is an accurate representation of the previous state of the page.
I'm tempted to leave this alone, but am open to comments on whether this is something we want to prevent. Feel free to chime in @dreamwhisper and @bgardner, if you have any thoughts.
Low priority, but when tapping a menu item on iOS and then tapping back, the menu appears open instead of closed.
Reproducible on https://demo.studiopress.com/infinity/ on iPhone by:
The menu remains open instead of closed.
The cause is document.ready not firing on iOS when clicking back. We likely need to run
_maybeClose
again on thepageshow
event.As a proof of concept, this in Genesis → Theme Settings → Footer Scripts solves the issue:
The text was updated successfully, but these errors were encountered: