-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
Paragraph fix #134
Paragraph fix #134
Changes from all commits
4e91801
45cb6a0
9a8b7ac
2f2acee
1aba0f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,14 +33,6 @@ public extension RichTextViewComponent { | |
_ alignment: RichTextAlignment | ||
) { | ||
if richTextAlignment == alignment { return } | ||
if !hasTrimmedText { | ||
let style = NSMutableParagraphStyle() | ||
style.alignment = alignment.nativeAlignment | ||
var attributes = richTextAttributes | ||
attributes[.paragraphStyle] = style | ||
typingAttributes = attributes | ||
} else { | ||
setRichTextAlignment(alignment, at: selectedRange) | ||
} | ||
setRichTextAlignment(alignment, at: selectedRange) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the issue in here is that I am testing on iOS and you on macOS. :D This will work on macOS but not on iOS because it doesnt set the typing attributes and the behaviour of text is quite different. What I suggest is to platform-check this and use set typing attributes on non-mac platform, that way we can actually ensure it works properly and test those under both platforms. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I actually tested continuously in both iOS and macOS. :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently not setting typing attributes causes obviously this: I am on it, hopefully I can fix this today so lets see. |
||
} | ||
} |
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.
This is IMHO needed for proper functionality but it probably needs to tweak a bit with some symbols. I am still wrapping my head around why setting alignment on a new line separated by newLineSeparator changes alignment of previous line as well...