-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Fix adjustsFontSizeToFit on new arch #43543
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
base: main
Are you sure you want to change the base?
Conversation
Base commit: 51e464f |
891e2ce
to
11e8411
Compare
@sammy-SC Could you have a look at this? |
This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Can anyone look at this? Pretty sure this is still needed. |
Could you rebase on main and retest on a recent version? |
Sounds good, I do have a rebased version of this for 0.76 so afaik it might not have changed much since. |
Hello) |
@janicduplessis do you mind rebasing this PR? We can't import it the PR is not updated. |
Hey @cipolleschi, I am currently on vacation, I will have a look when back to revive this pr. |
@janicduplessis Any updates?? |
Thanks for your work @janicduplessis. I've opened a partial replacement PR that attempts to address the issue of |
Summary:
When using adjustsFontSizeToFit on Fabric the behavior is different from the old renderer. The text will grow bigger than the current font size while on the old renderer it won't. The
minimumFontScale
is also not implemented. The code currently usesminimumFontSize
andmaximumFontSize
but those props do not actually exist.This brings the behavior closer to the old renderer by removing the wrong props and implementing
minimumFontScale
instead. From what I understand in the old renderer it would use the font size of the outermost text, but since we don't easily have access to that in Fabric I use the maximum font size of the attributed string.Changelog:
[IOS] [FIXED] - Fix adjustsFontSizeToFit on iOS Fabric
Test Plan:
This adds some example of the different behavior in RNTester
It doesn't grow
grows bigger than its original font sizeCan limit how small the text becomes with minimumFontScale
does not respect the minimumFontScale.Before
Old renderer iOS:
Old renderer Android
Fabric iOS:
Fabric Android
After
Fabric iOS:
Fabric Android: