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 maxFontSizeMultiplier prop on Text and TextInput components in new architecture #47614

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

RickardZrinski
Copy link

@RickardZrinski RickardZrinski commented Nov 14, 2024

Summary:

The maxFontSizeMultiplier prop for Text and TextInput was not handled in Fabric / New Architecture as documented in #47499.

Changelog:

[GENERAL] [FIXED] - Fix maxFontSizeMultiplier prop on Text and TextInput components in Fabric / New Architecture

Test Plan:

I have not added any automated tests for this change but try to do so if requested. I have however added examples to RN Tester for both the Text and TextInput components, as well as compared the behaviour with Paper / Old Architecture. Both on version 0.76.

Noticed now I didn't do exactly the same steps in both videos, oops! Be aware that reapplying changes made in the Settings are currently half-broken on the new architecture, thus I'm restarting the app on Android and iOS. But this issue is unrelated to my changes. I've tested on main branch and it has the same issue.

Here are comparison videos between Paper and Fabric on iOS after I've made my fix.

Text

Paper Fabric
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-11-13.at.19.39.32.mov
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-11-13.at.20.10.51.mov

TextInput

Paper Fabric
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-11-13.at.19.41.58.mov
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-11-13.at.20.12.15.mov

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Nov 14, 2024
@@ -61,6 +61,7 @@ public class TextAttributeProps {
public static final short TA_KEY_LINE_BREAK_STRATEGY = 25;
public static final short TA_KEY_ROLE = 26;
public static final short TA_KEY_TEXT_TRANSFORM = 27;
public static final short TA_KEY_MAX_FONT_SIZE_MULTIPLIER = 29;
Copy link
Author

Choose a reason for hiding this comment

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

Note that I've skipped 28 here. It's reserved by TA_KEY_ALIGNMENT_VERTICAL in attributedstring/conversions.h, but is missing its equivalent in this file. Might be another bug.

Copy link
Contributor

@cipolleschi cipolleschi left a comment

Choose a reason for hiding this comment

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

Amazing job! Thanks for working on this!

@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants