Draft: fix(iOS): Reorder back button setup logic so iOS renders it correctly when displayMode=minimal #3207
+78
−2
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
Partially fixes #2991. Unfortunately, not all cases are covered; see below.
When navigating from screen with headerShown: false to a screen that has a back button with displayMode=minimal, the width of the button appears to be the same as if it was meant for the first screen, with space allocated for a label that is not visible.
Changes
Simply moving the line that updates the displayMode after the rest of back button's setup code, solves the problem for apps which use displayMode=minimal.
Before
header-misaligned-before.mov
After
header-misaligned-after.mov
What still needs fixing
When mixing headerShown=false, displayMode=default and displayMode=minimal, the screen with displayMode=minimal still doesn't work. For now, please use workarounds suggested by the community in #2991.
header-misaligned-default.mov
Testing
Use Test2991, change
headerShown
, andheaderBackButtonDisplayMode
. For changes to take effect, it's good to close and reopen the app on the phone.