-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Mobile - RCTAztecView - Fixes font customization not getting updated #53391
Conversation
…when initializing the editor
@@ -689,7 +689,13 @@ class RCTAztecView: Aztec.TextView { | |||
/// | |||
private func refreshFont() { | |||
let newFont = applyFontConstraints(to: defaultFont) | |||
font = newFont |
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.
It's really interesting that this didn't take place before. I also see remnants of a past history where refreshFont
probably called refreshTypingAttributesAndPlaceholderFont
, due to the comment on line 702. 🤷
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.
Thanks for the fix @geriux!
In addition to the tests you provided I also tested VoiceOver and didn't spot any regressions. 🚀
# Conflicts: # packages/react-native-editor/CHANGELOG.md
Related PRs:
What?
This PR fixes an issue that started to happen after the recent React Native upgrade where the post title and some other functionality related to custom font size and font styles like bold formatting wouldn't work as expected.
Why?
It appears after setting the props
fontSize
,fontWeight
wouldn't reflect the changes when rendering or typing new content. This is an iOS-only issue and it was affecting the setup we currently have with Aztec.How?
By forcing to update the current
font
,defaultFont
, and the placeholder's font as well as thetypingAttributes
to keep them updated after the font props are set.I couldn't find another way to address this issue than by doing this proposal. We can explore other options if needed.
Testing Instructions
Scenario 1 - Post title placeholder shows the correct font styling
Scenario 2 - Test the text formatting options
Scenario 3 - Font size and line height
Testing Instructions for Keyboard
N/A
Screenshots or screencast
FontStylingBugiOS.MP4