Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): Chinese input no longer breaks before a skill pill on iOS #17614

Mergedilyaliao(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/17614/headmerged by juliusmarminge View on GitHub

Showing 1 changed file with 12 additions and 1 deletion.

x
0 of 1 viewed, 1 left
12 additions and 1 deletionapps/mobile/modules/t3-composer-editor/ios/T3ComposerEditorView.swiftModified
View file
@@ -469,6 +469,7 @@
private var pendingIconUris = Set<String>()
private var tokensNeedRebuild = false
private var chipsNeedMeasuredWidth = false
+ private var hasDeferredForcedRebuild = false
​
let onComposerChange = EventDispatcher()
let onComposerSelectionChange = EventDispatcher()
@@ -839,11 +840,21 @@
​
private func applyControlledDocument(force: Bool = false) {
+ // Rebuilding the attributed string tears down an active IME composition.
+ // Skip while marked text exists; committing the composition sends a new
+ // value from JS, and that update rebuilds, keeping any skipped force.
+ if textView.markedTextRange != nil {
+ hasDeferredForcedRebuild = hasDeferredForcedRebuild || force
+ updatePlaceholderVisibility()
+ return
Resolvedby coderabbitai[bot](GitHub profile, opens in a new tab)
+ }
+ let shouldForce = force || hasDeferredForcedRebuild
let currentSource = textView.serializedText()
- guard force || currentSource != value || !documentMatchesExpectedTokens() else {
+ guard shouldForce || currentSource != value || !documentMatchesExpectedTokens() else {
updatePlaceholderVisibility()
return
+ hasDeferredForcedRebuild = false