-
Notifications
You must be signed in to change notification settings - Fork 66
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 blockquote line height on iOS #587
Conversation
Waiting for @289Adam289's review |
BUG example app iOS: Toggle text font size button does not actually change size. Screen.Recording.2024-12-16.at.15.12.45.mov |
@289Adam289 As for #587 (comment), this is not a regression since it also happens on current Simulator.Screen.Recording.-.iPhone.16.Pro.-.2024-12-18.at.14.03.19.mp4 |
@289Adam289 I've narrowed down the root cause of this issue to those lines:
This logic was added in #416. When I remove these two lines, it works correctly: - [newTextCopy removeAttribute:@"NSFont" range:NSMakeRange(0, newTextCopy.length)];
- [oldTextCopy removeAttribute:@"NSFont" range:NSMakeRange(0, oldTextCopy.length)]; Simulator.Screen.Recording.-.iPhone.16.Pro.-.2024-12-18.at.14.44.43.mp4 |
I've checked #587 (comment) on main and indeed it is not a regression. I will test this pr on E/App and if everything goes well I think we can merge it. |
I've tested this pr on E/App and I could not find any regressions. We can safely merge. |
Fixed baseline offset jumps when adding heading in fc1d1e9
|
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.
🫣
Some video recordings from E/App with visible improvements:
|
Details
This PR fixes line height inside blockquote on iOS.
When
lineHeight
style is set onMarkdownTextInput
, React Native addsNSParagraphStyle
withminimumLineHeight
andmaximumLineHeight
to the attributed string.In Live Markdown, blockquote indent is set using another
NSParagraphStyle
withfirstLineHeadIndent
andheadIndent
.Currently, we create
NSParagraphStyle
using[NSParagraphStyle new]
, ignoring theNSParagraphStyle
created by React Native.This PR uses the
NSParagraphStyle
set by React Native when creatingNSParagraphStyle
for blockquotes.Screen.Recording.2024-12-16.at.12.11.27.mov
Screen.Recording.2024-12-16.at.12.10.45.mov
Related Issues
GH_LINK
Manual Tests
When testing, please set
lineHeight: 30
insidestyles.input
inApp.tsx
.Linked PRs