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(iOS): stuttering back arrow animation when using headerLargeTitle #2014

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ios/RNSScreenStackHeaderConfig.mm
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ + (void)updateViewController:(UIViewController *)vc

// When backBarButtonItem's title is null, back menu will use value
// of backButtonTitle
[backBarButtonItem setTitle:nil];
[backBarButtonItem setTitle:@" "];
Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately, this change still breaks how the hint for the previous screens looks like. With the changed title, it is being set to empty field, which is unacceptable. Can we think about the better approach or "hack" the hints in other way?

Screen.Recording.2024-01-22.at.12.07.33.mov

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The solutions that I found were setting an empty string or space. Others suggested to set a transparent color on the text. See: https://stackoverflow.com/questions/33025239/remove-text-from-back-button-keeping-the-icon

Copy link
Member

Choose a reason for hiding this comment

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

@dylancom thanks! I've tried some methods mentioned in StackOverflow, but unfortunately setting the text color to Clear doesn't fix that bug. Also, I've tried to create a custom menu that will contain the title of the previous screen, but somehow iOS doesn't replace it after calling setMenu (I also don't want to steer the menu manually). Hence I'm afraid I won't merge this for now - I don't want to sacrifice one functionality for another, but of course you can patch screens with this change on your own.

prevItem.backButtonTitle = resolvedBackTitle;
}
prevItem.backBarButtonItem = backBarButtonItem;
Expand Down
Loading