-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Fix maxFontSizeMultiplier
prop on Text
and TextInput
components in new architecture
#47614
Conversation
@@ -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; |
There was a problem hiding this comment.
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.
There was a problem hiding this 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!
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late reply, I added a feedback that has arrived internally that should be addressed.
...er/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm
Outdated
Show resolved
Hide resolved
Thanks for working on this and for applying the provided feedback! |
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
No problem, my pleasure! I see that the internal linter failed. For future reference, any way to run that linter, or any other native code linter/autoformatter locally? And while I have you: how do I run all of the iOS tests through Xcode? For RN tester I know I can just open Sorry for the off topic, but it'll help me contribute in the future 😊 |
The JS linters are aligned, but the iOS ones no. This is a step we have to do ourselves from the internal repository.
Yeah, that has been on my plate for a while, since... I need to get back to them but I didn't have time yet. The script does nothing magical:
You can do the first two steps manually (the websocket server can be launched running |
Brief update here: it is taking a little bit of time to land this because we need to add E2E internally and it is not as straightforward as we expected. |
Thanks for the update! I understand. Let me know if there's anything I can assist with. |
Curious if there is any update on this? |
Sorry for the delay... our internal E2E infrastructure is much more complex than what I was expecting and to enable the I'll try to land this, splitting the tests in a separate change to unblock the situation. |
@cipolleschi merged this pull request in 97cf42f. |
This pull request was successfully merged by @RickardZrinski in 97cf42f When will my fix make it into a release? | How to file a pick request? |
I am curious: will this fix be included in react native .78? |
Yep: reactwg/react-native-releases#765 |
… in new architecture (#47614) Summary: The `maxFontSizeMultiplier` prop for `Text` and `TextInput` was not handled in Fabric / New Architecture as documented in #47499. bypass-github-export-checks ## Changelog: [GENERAL] [FIXED] - Fix `maxFontSizeMultiplier` prop on `Text` and `TextInput` components in Fabric / New Architecture Pull Request resolved: #47614 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 | | ------------- | ------------- | | <video src="https://github.com/user-attachments/assets/f4fd009f-aa6d-41ab-92fa-8dcf1e351ba1" /> | <video src="https://github.com/user-attachments/assets/fda42cc6-34c2-42a7-a6e2-028e7c866075" /> | ### TextInput | Paper | Fabric | | ------------- | ------------- | | <video src="https://github.com/user-attachments/assets/59b59f7b-25d2-4b5b-a8e2-d2054cc6390b" /> | <video src="https://github.com/user-attachments/assets/72068566-8f2a-4463-874c-45a6f5b63b0d" /> | Reviewed By: Abbondanzo Differential Revision: D65953019 Pulled By: cipolleschi fbshipit-source-id: 90c3c7e236229e9ad9bd346941fafe4af8a9d9fc
… in new architecture (#47614) Summary: The `maxFontSizeMultiplier` prop for `Text` and `TextInput` was not handled in Fabric / New Architecture as documented in #47499. bypass-github-export-checks [GENERAL] [FIXED] - Fix `maxFontSizeMultiplier` prop on `Text` and `TextInput` components in Fabric / New Architecture Pull Request resolved: #47614 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. | Paper | Fabric | | ------------- | ------------- | | <video src="https://github.com/user-attachments/assets/f4fd009f-aa6d-41ab-92fa-8dcf1e351ba1" /> | <video src="https://github.com/user-attachments/assets/fda42cc6-34c2-42a7-a6e2-028e7c866075" /> | | Paper | Fabric | | ------------- | ------------- | | <video src="https://github.com/user-attachments/assets/59b59f7b-25d2-4b5b-a8e2-d2054cc6390b" /> | <video src="https://github.com/user-attachments/assets/72068566-8f2a-4463-874c-45a6f5b63b0d" /> | Reviewed By: Abbondanzo Differential Revision: D65953019 Pulled By: cipolleschi fbshipit-source-id: 90c3c7e236229e9ad9bd346941fafe4af8a9d9fc
This pull request was successfully merged by @RickardZrinski in c0e6523 When will my fix make it into a release? | How to file a pick request? |
… in new architecture (#47614) Summary: The `maxFontSizeMultiplier` prop for `Text` and `TextInput` was not handled in Fabric / New Architecture as documented in #47499. bypass-github-export-checks [GENERAL] [FIXED] - Fix `maxFontSizeMultiplier` prop on `Text` and `TextInput` components in Fabric / New Architecture Pull Request resolved: #47614 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. | Paper | Fabric | | ------------- | ------------- | | <video src="https://github.com/user-attachments/assets/f4fd009f-aa6d-41ab-92fa-8dcf1e351ba1" /> | <video src="https://github.com/user-attachments/assets/fda42cc6-34c2-42a7-a6e2-028e7c866075" /> | | Paper | Fabric | | ------------- | ------------- | | <video src="https://github.com/user-attachments/assets/59b59f7b-25d2-4b5b-a8e2-d2054cc6390b" /> | <video src="https://github.com/user-attachments/assets/72068566-8f2a-4463-874c-45a6f5b63b0d" /> | Reviewed By: Abbondanzo Differential Revision: D65953019 Pulled By: cipolleschi fbshipit-source-id: 90c3c7e236229e9ad9bd346941fafe4af8a9d9fc
Summary:
The
maxFontSizeMultiplier
prop forText
andTextInput
was not handled in Fabric / New Architecture as documented in #47499.Changelog:
[GENERAL] [FIXED] - Fix
maxFontSizeMultiplier
prop onText
andTextInput
components in Fabric / New ArchitectureTest 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
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
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