Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation bar affected by cache #196

Open
sebastienwozny opened this issue Mar 15, 2024 · 2 comments
Open

Navigation bar affected by cache #196

sebastienwozny opened this issue Mar 15, 2024 · 2 comments

Comments

@sebastienwozny
Copy link

Hey!

I run into a problem while developing my app and I realize that it's also present in the demo.
The navigation bar doesn't work properly and the only thing that makes it work well in my app is to disable the cache on the Rails side: meta name="turbo-cache-control" content="no-cache"

Are you experiencing the same problem?

navigation_bar.mp4
@joemasilotti
Copy link
Member

I can reproduce the same issue but I don't think that disabling the cache is a viable solution. I'm more inclined to make the default navigation bar (in Turbo Navigator) always opaque. That way the web content never "slides under" it - exactly what happens on the first visit in your video.

let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
UINavigationBar.appearance().standardAppearance = appearance
UINavigationBar.appearance().scrollEdgeAppearance = appearance
UINavigationBar.appearance().compactAppearance = appearance

@jayohms, we can definitely add this to the demo. But how do you feel about making it the default with Turbo Navigator? I'm inclined to do so - I've done it on 100% of the client apps I work on. But curious if I am missing something that perhaps HEY or Basecamp does.

@CopperGiraffe
Copy link

Helloo, if this is cache related, is there another way to handle this issue ?
The same happens with largeTitles it will sometime not retract itself correctly, even when using the opaque background trick (which I would like to avoid if possible)

Simulator Screen Recording - iPhone 15 Pro - 2024-06-14 at 10 44 28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants