Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): follow writing direction in the iOS composer #48284

OpenDananz(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/48284/headopened View on GitHub

Showing 5 changed files with 129 additions and 5 deletions (loading 2).

x
0 of 5 viewed, 5 left
77 additions and 5 deletionsapps/mobile/modules/t3-composer-editor/ios/T3ComposerEditorView.swiftModified
View file
@@ -27,10 +27,26 @@
let end: Int
​
+private struct ComposerParagraphDirectionPayload: Decodable {
+ enum Direction: String, Decodable {
+ case ltr
+ case rtl
+​
+ var writingDirection: NSWritingDirection {
+ self == .rtl ? .rightToLeft : .leftToRight
+ }
+ }
+​
+ let start: Int
+ let end: Int
+ let direction: Direction
+}
+​
private struct ComposerControlledDocumentPayload: Decodable {
let value: String
let selection: ComposerSelectionPayload?
let tokensJson: String
+ let paragraphDirections: [ComposerParagraphDirectionPayload]?
let mostRecentEventCount: Int
let isNativeEcho: Bool
let resetGeneration: Int
@@ -532,6 +548,8 @@
private let textView = ComposerTextView(usingTextLayoutManager: false)