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: HeaderConfig impacts layout of Screen's contents #2395

Merged
merged 4 commits into from
Oct 10, 2024

Conversation

alduzy
Copy link
Member

@alduzy alduzy commented Oct 9, 2024

Description

This PR fixes headerConfig's incorrect layout with custom subviews after recent changes in #2325.

Note

@kkafar:
Previously, before #2325, all children of the headerConfig component have been positioned absolutely, thus the headerConfig was always of height 0, not impacting layout of other components. After #2325, headerConfig's children are positioned using flexbox. This implies that it has no longer height of 0, thus it impacts the layout of other other elements, in particular ScreenContentWrapper, which is offset by the height of the highest header config subview.

The initial idea to solve this was to set height: 0; overflow: visible, however, for some yet unknown reason the subviews become invisible with such styles set of headerConfig. Note that if you set the height: 1 it works as expected.

Due to above hindrance we decided to position the headerConfig approximately at the position of native header, by setting top: -100%. To prevent the headerConfig from blocking gestures we set pointerEvents: 'box-none'.

In the end I want to note, that it would be best if we came out with solution that excludes headerConfig from layout as it was before #2325.

Changes

  • added Test2395.tsx repro
  • adjusted headerConfig's styles

Screenshots / GIFs

Before

Screenshot 2024-10-09 at 12 48 32

After

Screenshot 2024-10-09 at 12 47 57

Test code and steps to reproduce

  • use Test2395.tsx repro

Checklist

  • Included code example that can be used to test this change
  • Ensured that CI passes

@alduzy alduzy force-pushed the @alduzy/header-config-layout-fix branch 3 times, most recently from 98e25f8 to 75133a8 Compare October 9, 2024 10:37
Co-authored-by: Kacper Kafara <kacperkafara@gmail.com>
@alduzy alduzy force-pushed the @alduzy/header-config-layout-fix branch from 75133a8 to e58816f Compare October 9, 2024 10:37
@alduzy alduzy marked this pull request as ready for review October 9, 2024 10:38
@alduzy alduzy requested a review from kkafar October 9, 2024 10:38
@alduzy alduzy force-pushed the @alduzy/header-config-layout-fix branch from e75c4f0 to dbaa1eb Compare October 9, 2024 10:48
@kkafar kkafar changed the title fix: headerConfig layout fix: HeaderConfig impacts layout of Screen's contents Oct 10, 2024
Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

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

From initial testing looks good, we can release it in beta.

@alduzy alduzy merged commit bcd7faf into main Oct 10, 2024
3 checks passed
@alduzy alduzy deleted the @alduzy/header-config-layout-fix branch October 10, 2024 08:20
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