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
I've got another issue… 😅
I'm using BottomSheet on a View containing an embedded MapBox map and I got a crash while initially loading the view. It occurs about half the time and when it doesn't crash, the map is animating weirdly. Like, it expands from the top-left corner to the bottom-right corner in a slow manner.
Upon further investigation, I noticed this only happened if I used BottomSheet. Having recently read that the standard animation() function is now deprecated. I theorised that maybe it's the use of animations by the library that could be the culprit. Since BottomSheet is used with a View Modifier, potential animations in the sheet could impact the rest of the app.
I made a fork of the library to see if I could fix my bug. And I did! I just had to remove a few withAnimation() calls. Now I don't have my crash anymore and apparently the BottomSheet is still behaving and animating ok. See the commit here.
I think the correct solution would be to use the now recommended way of doing animations. I mean animation(_:value:). Doing this would ensure that the animations are restricted to only the relevant state changes.
I don't know a lot about all of this, having seldom used animations in SwiftUI myself. Anyway, I'm sorry for reporting a lot of issues, and I thank you for maintaining this project. 🙂
The text was updated successfully, but these errors were encountered:
Yes this is indeed something I want to change in a future release. But only for code style purposes and not for functionality. I’m already removed all implicit animations (see #31) and I’m not sure how the withAnimation { } clousure crashes your app, when .animation(value) doesn't.
the map is animating weirdly. Like, it expands from the top-left corner to the bottom-right corner in a slow manner.
Have you tried using .fixedSize() on your map? Does this fix it?
Thank you for your very helpful answers! You helped me a lot on my other reported issues. I'm sorry, I really thought I'd found a problem and that I was helping. 🙏
I hadn't tried using .fixedSize(), but I just did and it breaks my component. For now, I'll stick with my quick fix… But this issue is the most complex I think. It could also come from MapBox, or from the way I'm embedding it in SwiftUI. I'll keep you posted if I find anything relevant to BottomSheet.
Hello again,
I've got another issue… 😅
I'm using BottomSheet on a View containing an embedded MapBox map and I got a crash while initially loading the view. It occurs about half the time and when it doesn't crash, the map is animating weirdly. Like, it expands from the top-left corner to the bottom-right corner in a slow manner.
Upon further investigation, I noticed this only happened if I used BottomSheet. Having recently read that the standard
animation()
function is now deprecated. I theorised that maybe it's the use of animations by the library that could be the culprit. Since BottomSheet is used with a View Modifier, potential animations in the sheet could impact the rest of the app.I made a fork of the library to see if I could fix my bug. And I did! I just had to remove a few
withAnimation()
calls. Now I don't have my crash anymore and apparently the BottomSheet is still behaving and animating ok. See the commit here.I think the correct solution would be to use the now recommended way of doing animations. I mean animation(_:value:). Doing this would ensure that the animations are restricted to only the relevant state changes.
I don't know a lot about all of this, having seldom used animations in SwiftUI myself. Anyway, I'm sorry for reporting a lot of issues, and I thank you for maintaining this project. 🙂
The text was updated successfully, but these errors were encountered: