-
-
Notifications
You must be signed in to change notification settings - Fork 532
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alduzy
force-pushed
the
@alduzy/header-config-layout-fix
branch
3 times, most recently
from
October 9, 2024 10:37
98e25f8
to
75133a8
Compare
Co-authored-by: Kacper Kafara <[email protected]>
alduzy
force-pushed
the
@alduzy/header-config-layout-fix
branch
from
October 9, 2024 10:37
75133a8
to
e58816f
Compare
alduzy
force-pushed
the
@alduzy/header-config-layout-fix
branch
from
October 9, 2024 10:48
e75c4f0
to
dbaa1eb
Compare
kkafar
changed the title
fix: headerConfig layout
fix: Oct 10, 2024
HeaderConfig
impacts layout of Screen
's contents
kkafar
approved these changes
Oct 10, 2024
There was a problem hiding this 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.
2 tasks
alduzy
added a commit
that referenced
this pull request
Oct 28, 2024
## Description This PR fixes title being invisible when searchbar is enabled. In #2395 I added `alignItems: 'center'` style to the header config component. It aimed to fix iOS subviews floating mid-screen when a larger subview is provided: | (iOS) without `alignItems: 'center'` | (iOS) with `alignItems: 'center'`| | --- | --- | | ![Simulator Screenshot - iPhone 16 Pro - 2024-10-28 at 09 36 53](https://github.com/user-attachments/assets/3066b95a-4904-41e7-b8d5-b56c985cd751) | ![Simulator Screenshot - iPhone 16 Pro - 2024-10-28 at 09 37 07](https://github.com/user-attachments/assets/673bd550-9a8b-4200-acfc-c80f1ebea0a3) | This change unintentionally introduced a regression on Android. When searchabar is enabled, the `ScreenStackHeaderConfig` components height is equal 0 and it does not 'stretch' to accomodate the native title. Simple solution is to center align the subviews depending on the Platform. | (Android) with `alignItems: 'center'` | (Android) without `alignItems: 'center'` | | --- | --- | | ![Screenshot_1730106776](https://github.com/user-attachments/assets/e1a8f358-3560-413d-b8ea-0426cfeaefc2) | ![Screenshot_1730106784](https://github.com/user-attachments/assets/b746bc5c-4c7f-4277-a5ec-fa291d5390d4) | ## Changes - updated `Test2395.tsx` repro - center aligning items conditionally based on Platform ## Test code and steps to reproduce - use `Test2395.tsx` repro ## Checklist - [x] Included code example that can be used to test this change - [x] Ensured that CI passes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theheight: 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 setpointerEvents: '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
Test2395.tsx
reproScreenshots / GIFs
Before
After
Test code and steps to reproduce
Test2395.tsx
reproChecklist