Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): unify draft and thread navigation and composer behavior #23467

Mergedjuliusmarmingemerged 43 commits intomain fromrefs/pull/23467/headmerged by juliusmarminge View on GitHub

Showing 78 changed files with 12 additions and 23 deletions (loading 75).

x
0 of 78 viewed, 78 left
12 additions and 23 deletionsapps/mobile/modules/t3-composer-editor/ios/T3ComposerEditorView.swiftModified
View file
@@ -467,7 +467,8 @@
public required init(appContext: AppContext? = nil) {
super.init(appContext: appContext)
​
- clipsToBounds = false
+ clipsToBounds = true
+ textView.clipsToBounds = true
textView.delegate = self
textView.textDropDelegate = self
textView.backgroundColor = .clear
@@ -1215,28 +1216,16 @@
private func emitContentSizeIfNeeded() {
- // The laid-out text without insets. A one-line draft reports its natural width, so
- // JS can tell whether it fits a narrower row than the one it is laid out in; past
- // one line only the height matters, so layout stops at the second line. The width
- // comes from the line fragment because usedRect spans the container once the view
- // scrolls. A trailing newline's empty line only exists as the extra fragment.
- let layout = textView.layoutManager
- let container = textView.textContainer
- var lines = 0
- var width: CGFloat = 0
- var height: CGFloat = 0
- let glyphs = NSRange(location: 0, length: layout.numberOfGlyphs)
- layout.enumerateLineFragments(forGlyphRange: glyphs) { _, used, _, _, stop in
- lines += 1
- width = used.width
- height = used.maxY