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

Effects for navigation bar in modal #97

Closed
tabuna opened this issue Aug 27, 2022 · 13 comments
Closed

Effects for navigation bar in modal #97

tabuna opened this issue Aug 27, 2022 · 13 comments

Comments

@tabuna
Copy link

tabuna commented Aug 27, 2022

Hello, I'm a newbie. I'm following the Demo from this repository completely, and I've come across the fact that the navbar in modal windows sometimes doesn't appear with a blur.  

At first, I sinned on my HTML layout, but it doesn't seem to be the case. I recorded a video example from my device, where I opened the same page several times, where the blur effect appears / is absent. I don't see any pattern and would appreciate any advice.

Upload.from.GitHub.for.iOS.MOV
@joemasilotti
Copy link
Member

Whoa, weird! It looks like it's working the first time but then not on subsequent loads?

Do you have any code changes to the template?

@tabuna
Copy link
Author

tabuna commented Aug 27, 2022

Hi @joemasilotti I didn't notice any pattern in this. The effect can be applied both from the first opening and much later or not appear at all.

This is a copy from https://github.com/hotwired/turbo-ios/tree/main/Demo where the name and URL have been changed etc., I did change some code like disabling link previews (From your blog). But I don't think it led to it. I invited you to the project so that you can look at the code if you have a desire, and not just guess.

@joemasilotti
Copy link
Member

Got it – I don't see anything out of the ordinary in your code.

Can you try adding the following somewhere before the first modal is presented? It could be in AppDelegate even.

UINavigationBar.appearance().isOpaque = true
UINavigationBar.appearance().isTranslucent = false

@tabuna
Copy link
Author

tabuna commented Aug 27, 2022

The following result:

Upload.from.GitHub.for.iOS.MOV

@tabuna
Copy link
Author

tabuna commented Sep 4, 2022

New additional information. In the console I see the following information:

[ViewportSizing] minimumViewportInset cannot be larger than frame

@joemasilotti
Copy link
Member

OK, one more try. Can you see if this helps?

let navigationBarAppearance = UINavigationBarAppearance()
navigationBarAppearance.configureWithDefaultBackground()

UINavigationBar.appearance().standardAppearance = navigationBarAppearance
UINavigationBar.appearance().scrollEdgeAppearance = navigationBarAppearance
UINavigationBar.appearance().isOpaque = true
UINavigationBar.appearance().isTranslucent = false

@tabuna
Copy link
Author

tabuna commented Nov 22, 2022

It seems to work great. I tested it both in the emulator and on a real device, and I was no longer able to reproduce the effect. Thanks a lot. But now the top header is always on its own background.

@joemasilotti
Copy link
Member

I think that's the tradeoff with setting an opaque navigation bar, sadly.

@henrysipp
Copy link

#73 actually resolves this issue completely.

@joemasilotti
Copy link
Member

@henrysipp, do you need to make any of the appearance changes, too? Or only with the cover fix?

@henrysipp
Copy link

No, just pulling and using that branch seems to have solved everything.

@JoshAntBrown
Copy link

Same here, completely resolved a similar issue I was having with the translucency no need for any appearance changes. Would be good to get it merged into main.

@joemasilotti
Copy link
Member

Noted that #73 fixes this issue as well. I'm going to close this and track work there.

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

4 participants