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

[Sheets] Allow specifying an initial height #5669

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mozzius
Copy link
Member

@mozzius mozzius commented Oct 10, 2024

Adds a new initialHeight prop to the iOS sheets which allows them to open at half or full size initially

I wasn't able to see how you'd go about doing this on Android

Simulator.Screen.Recording.-.iPhone.16.-.2024-10-10.at.16.42.48.mp4

Copy link

The Pull Request introduced fingerprint changes against the base commit:

Fingerprint diff
[{"type":"dir","filePath":"modules/bottom-sheet/android","reasons":["expoAutolinkingAndroid"],"hash":"30e5806c53396f6007e16a780ba6881706781c23"},{"type":"dir","filePath":"modules/bottom-sheet/ios","reasons":["expoAutolinkingIos"],"hash":"a630f462f5c93a5d5f670dc95d79508d603fdb1e"}]

Generated by PR labeler 🤖

Copy link

Old size New size Diff
7.89 MB 7.89 MB 0 B (0.00%)

Comment on lines +57 to +63
if initialHeight == "half" {
if (screenHeight - 100) / 2 > contentHeight {
sheet.detents.insert(.medium(), at: 0)
} else {
sheet.detents.append(.medium())
}
}
Copy link
Member Author

@mozzius mozzius Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part is sus, I don't know the proper way to determine the real height of .medium. Docs say they have to be ordered but I don't know what the consequences are of it not being ordered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants