react-native-screens icon indicating copy to clipboard operation
react-native-screens copied to clipboard

Long titles don't get truncated on native stack screens

Open thomasttvo opened this issue 1 year ago • 6 comments

Description

on iOS:

  • When the title option is used on ScreenStackHeaderConfig, then the long title works great. image

  • However, when we use ScreenStackHeaderCenterView, the long title overlaps the right element. image

on Android:

  • The long title overlaps the right element in both cases

Steps to reproduce

mentioned in description

Snack or a link to a repository

--

Screens version

3.25.0

React Native version

0.72.5

Platforms

Android, iOS

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

thomasttvo avatar Oct 23 '23 22:10 thomasttvo

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

github-actions[bot] avatar Oct 23 '23 22:10 github-actions[bot]

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Snack or a link to a repository section.

github-actions[bot] avatar Oct 23 '23 22:10 github-actions[bot]

Hi @thomasttvo, thanks for submitting the issue! Unfortunately this bug is not that easy to resolve - as for subviews of the header we're basically just using Gravity to position the elements, we're not calculating dynamically if the one subview will overlap another. Currently we've got planned something other to go around this bug, which is... to just toolbar.isTitleCentered for centerizing the title on Android (which already truncates the title) 😅 This should fully fix this bug, as i believe centerizing the title for iOS is not necessary, since iOS already have the title centered?

More or less, I think centerizing the header's title will be much better than using center view for rendering header's title.

tboba avatar Oct 24 '23 08:10 tboba

More or less, I think centerizing the header's title will be much better than using center view for rendering header's title.

do you mean that will fix Android in the case of using title? That's great if it works. We can switch to just using title if we need to.

Would still be great though for it to work with custom title views. Possibly wrap the subview in another view that has some dynamic measurement might be the solution.

thomasttvo avatar Oct 24 '23 18:10 thomasttvo

we're also facing this issue, any updates on this? thanks

hugo-advizr avatar Apr 12 '24 07:04 hugo-advizr