Open
Description
Prerequisites
- ✅ I checked the documentation and found no answer
- ✅ I checked to make sure that this issue has not already been filed
Expected Behavior
- Presenting view that takes the whole heigh but not the full screen
- Stable ability to change height of a view according to Drag Detent values in config
- During changing a view height it doesn't ignore using of Spacer and content that supposed to be on the top / bottom of the view stays there.
Please describe the behavior you are expecting
Current Behavior
- If i'm using
Spacer
in a view and use.large
Drag Detent case it tries to set the height to full screen. - If i'm using
Spacer
in a view and use.large
Drag Detent case sometimes drag action leads to dismissing view instead of height change. - If i'm using
Spacer
in a view and drag view to change height it leads to ignoring a Spacer value and view's content stays on the bottom, however sometimes it recalculatesSpacer
height correctly.
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
- Make an instance of
TestDragDetentView
and present it - Try to drag view down and back
Code Sample
Example built with using Demo app Popups Demo
struct TestDragDetentView: TopPopup {
var body: some View {
VStack(spacing: 0) {
createBrandingContent()
Spacer.width(40).background(Color.red)
createButton()
createDragIndicator()
}
.padding(.horizontal, 28)
}
func configurePopup(config: TopPopupConfig) -> TopPopupConfig {
config
.dragDetents([.fraction(1.4), .large])
.cornerRadius(24)
.heightMode(.auto)
}
}
private extension TestDragDetentView {
func createBrandingContent() -> some View {
BrandingContent()
.setAppearance(.nonCompact)
.padding(.top, 32)
.padding(.bottom, 20)
}
func createButton() -> some View {
Buttons.dismiss
.getView()
.setHeight(to: .small)
}
func createDragIndicator() -> some View {
RoundedRectangle(cornerRadius: 42)
.fill(Color.borderSecondary)
.frame(width: 40, height: 4, alignment: .center)
.padding(.top, 12)
.padding(.bottom, 16)
}
}
Videos
https://github.com/user-attachments/assets/cab9963f-c289-40f6-b81a-ceea1257ea17
https://github.com/user-attachments/assets/a41f429f-504c-449b-9802-4b1947e8ecb2
Context
It works stable if i'm not using Spacer
. Probably Spacer
doesn't allow to count view's size correctly.
It has problems for both: top and bottom popup
Name | Version |
---|---|
SDK | 3.0.0 |
Xcode | 16.1 |
Operating System | iOS 18.1 |
Device | iPhone 16 |
Metadata
Metadata
Assignees
Type
Projects
Status
Backlog