react-native-screens
react-native-screens copied to clipboard
Long titles don't get truncated on native stack screens
Description
on iOS:
-
When the
title
option is used onScreenStackHeaderConfig
, then the long title works great. -
However, when we use
ScreenStackHeaderCenterView
, the long title overlaps the right element.
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
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?
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.
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.
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.
we're also facing this issue, any updates on this? thanks