-
-
Notifications
You must be signed in to change notification settings - Fork 502
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
Long titles don't get truncated on native stack screens #1946
Comments
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! 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 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 |
Yeah, I think I have some insight here now (on iOS). Recently when working on |
still happening, I filed a bug in React Navigation, linking here since their contributor suggested I post in react-native-screens since it uses react-native-screens |
Hey, I will update you here a bit, as we did spend some time debugging it. @alduzy please correct my message if I'm wrong at some point. Talking Android here: The text is properly truncated when it is mounted natively as In case when it is not properly truncated, so when you specify
What's important here: react's text view is laid out by Yoga. Yoga does use If you don't have Possible solutionsUndecided yet. |
Description
on iOS:
When the![image](https://private-user-images.githubusercontent.com/2142140/277494200-979c7b2f-f2a3-434b-b0be-36100cf60343.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIyODM3NTcsIm5iZiI6MTcyMjI4MzQ1NywicGF0aCI6Ii8yMTQyMTQwLzI3NzQ5NDIwMC05NzljN2IyZi1mMmEzLTQzNGItYjBiZS0zNjEwMGNmNjAzNDMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjlUMjAwNDE3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NDI0ZTU0MjMyMDZlNmY1NmQ1YTg0Mjk2NmNkMWMyZmQ4YTI5NTRhYWRlM2MyOGRiODFkOGM2MjFhYTdiN2QxMiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.WJj-ZESVsfEk5sVU_DXjtf5ew1vMmZkg0-REfcHlXnw)
title
option is used onScreenStackHeaderConfig
, then the long title works great.However, when we use![image](https://private-user-images.githubusercontent.com/2142140/277494036-676db852-8e16-48c0-93e3-e426246838ae.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIyODM3NTcsIm5iZiI6MTcyMjI4MzQ1NywicGF0aCI6Ii8yMTQyMTQwLzI3NzQ5NDAzNi02NzZkYjg1Mi04ZTE2LTQ4YzAtOTNlMy1lNDI2MjQ2ODM4YWUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjlUMjAwNDE3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NzU1ODk0YmQxNGE5YjMyYWQ0OWY4YTFkNDNmOTZlYzU2MTFjMTJlNDU0YTNlNDdjN2ZlYTIxMWRjNGU1MTFhMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.7BDkm7iq763E7mhPS8NrArpyxc8Mv4_ReXMUZRtm6uQ)
ScreenStackHeaderCenterView
, the long title overlaps the right element.on Android:
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
The text was updated successfully, but these errors were encountered: