After literal months of trying to reproduce a really weird SwiftUI bug I have FINALLY found a way to isolate it!

If you have a ScrollView that contains a button which presents a .sheet(), then the user backgrounds the app WHILE the sheet is presented. Then when they return to the app and dismiss the sheet the ScrollView's content looks fine but taps are offset vertically w/ the top untappable.

Anyone run into this before or know how to fix it?

Gist to reproduce it: gist.github.com/UnderscoreDavi

Follow

@_Davidsmith Yup. To workaround, you need to force the body to be re-evaluated (add an EmptyView or something)

· Edited · · Ivory for Mac · 3 · 5 · 44

@phill Thank you so much for the suggestion and workaround that seems to do the trick!

@phill @_Davidsmith something like `.id(presentSheet1 || presentSheet2)` should also work

Sign in to participate in the conversation
The Not So Big Company

The home of The Not So Big Company on Mastodon.