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

fix: make header height context available to all overlay sheets #1742

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

tm-ruxandra
Copy link
Contributor

Description

We had issues with nested overlay sheets opening to inconsistent heights, which in turn made their close buttons inaccessible. This was because the HeaderHeight context that tells them their opening limit is scoped to the ScreenScaffold component, which is context that nested sheets do not have (since they are opening in the BottomSheetModalProvider outside of the scaffold). This fixes the issue by making HeaderHeight context available to the entire app, with ScreenScaffold just setting the current value as a side effect.

Checklist

  • Corresponding issue has been opened

Related Issues

#1651

Verification steps

Open info overlay sheets, including the nested ones in Soil ID, and verify that all open to the expected height and can be closed on both IOS and Android.

Copy link
Contributor

@knipec knipec left a comment

Choose a reason for hiding this comment

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

Just to confirm understanding: The first OverlaySheet would be a child of the ScreenScaffold, so would receive the headerHeight via the context, but subsequent nested OverlaySheets would not receive it because they'd exist at some other level of the component hierarchy that was not a child of the ScreenScaffold -- is that accurate?

dev-client/src/screens/ScreenScaffold.tsx Show resolved Hide resolved
@tm-ruxandra
Copy link
Contributor Author

@knipec that's correct.

@tm-ruxandra tm-ruxandra merged commit 13f8f05 into main Jul 10, 2024
9 checks passed
@tm-ruxandra tm-ruxandra deleted the fix/header-height-consistency branch July 10, 2024 21:17
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