LeoNatan / LNPopupUI

A SwiftUI library for presenting views as popups, much like the Apple Music and Podcasts apps.
MIT License
320 stars 29 forks source link

popupBarCustomView produces too much padding #40

Closed LeoNatan closed 4 months ago

LeoNatan commented 4 months ago

Discussed in https://github.com/LeoNatan/LNPopupUI/discussions/39

Originally posted by **dsk1306** April 12, 2024 I've been playing around with the library and noticed some strange behavior. I've added a simple view with some content ```swift var body: some View { Color.red .ignoresSafeArea(edges: [.top, .bottom]) .popupCloseButtonStyle(.none) .popupInteractionStyle(.customizedSnap(percent: 0.5)) .popup( isBarPresented: $coordinator.isBarPresented, isPopupOpen: $coordinator.isPopupOpen, onClose: { coordinator.onPopupClose?() }, popupContent: { Text("test") } ) .popupBarCustomView(wantsDefaultHighlightGesture: false) { VStack { Text("line 1") Text("line 2") Text("line 3") } } } ``` and for some reason the hosting view adds quite a lot of vertical space around my content view. ![Screenshot 2024-04-12 at 13 49 13](https://github.com/LeoNatan/LNPopupUI/assets/9428706/d4dcedd9-913c-4618-9458-955a3f648359) ![Screenshot 2024-04-12 at 13 49 22](https://github.com/LeoNatan/LNPopupUI/assets/9428706/8d8efdb6-03ae-4dd4-b8b4-a32d81f1e397) I've tried to ignore safe area in custom view ```swift .popupBarCustomView(wantsDefaultHighlightGesture: false) { VStack(spacing: .zero) { Text("line 1") Text("line 2") Text("line 3") } .ignoresSafeArea() } ``` but it seems that the hosting view size stays the same ![Screenshot 2024-04-12 at 13 58 28](https://github.com/LeoNatan/LNPopupUI/assets/9428706/14b613e5-735a-492f-b612-e583754b43ef) Do you think it's possible to remove these paddings without breaking the layout logic?
LeoNatan commented 4 months ago

@dsk1306 Please try with version 1.7.4. Thanks

dsk1306 commented 4 months ago

@LeoNatan Yep, seems to be working great now. Thanks!