Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): sending on iOS no longer leaves an autocorrected draft behind #26452

Mergedsaphid(GitHub profile, opens in a new tab)merged 6 commits intomain fromrefs/pull/26452/headmerged by juliusmarminge View on GitHub

Showing 10 changed files with 111 additions and 4 deletions (loading 7).

x
0 of 10 viewed, 10 left
3 additions and 0 deletionsapps/mobile/modules/t3-composer-editor/ios/T3ComposerEditorModule.swiftModified
View file
@@ -132,6 +132,9 @@
AsyncFunction("setSelection") { (view: T3ComposerEditorView, start: Int, end: Int) in
view.setSelection(start: start, end: end)
+ AsyncFunction("readState") { (view: T3ComposerEditorView) -> [String: Any] in
+ view.readState()
+ }
17 additions and 0 deletionsapps/mobile/modules/t3-composer-editor/ios/T3ComposerEditorView.swiftModified
View file
@@ -447,6 +447,8 @@
private var isReadOnly = false
private var isApplyingControlledValue = false
private var nativeEventCount = 0
+ // Count of the latest intercepted paste, so a flush can tell whether JS has received it.
+ private var lastPasteEventCount = 0
Resolvedby coderabbitai[bot](GitHub profile, opens in a new tab)
private var hasControlledDocument = false
private var resetGeneration = 0
private var lastContentSize = CGSize.zero
@@ -499,6 +501,7 @@
guard let self else { return }
let selection = self.sourceSelection()
self.nativeEventCount += 1
+ self.lastPasteEventCount = self.nativeEventCount