Skip to content

Conversation

kmichalikk
Copy link
Collaborator

@kmichalikk kmichalikk commented Sep 10, 2025

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, and headerBackButtonDisplayMode. For changes to take effect, it's good to close and reopen the app on the phone.

@kmichalikk kmichalikk requested a review from kkafar September 10, 2025 09:15
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.

This looks promising, but we need to verify that the second interaction described in the PR (the one that still requires fixing) is not a regression introduced by this PR & is reproducible on main branch.

Could you confirm that?

@kmichalikk kmichalikk changed the title fix(iOS): Reorder back button setup logic so iOS renders it correctly when displayMode=minimal Draft: fix(iOS): Reorder back button setup logic so iOS renders it correctly when displayMode=minimal Sep 10, 2025
@kmichalikk kmichalikk marked this pull request as draft September 10, 2025 09:51
@kmichalikk
Copy link
Collaborator Author

kmichalikk commented Sep 10, 2025

It looked fine-ish until I tried the other way around, from first to third, to first, to second. Now second is always minimal. I'd say it's not an improvement then. Converting it to Draft.

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.

[iOS] Header Title Misaligned When First Stack Screen Has No Native Header

2 participants