Skip to content

Commit 6f99897

Browse files
fix(mobile): Android composer no longer accepts autofill
The composer's EditText kept an editable TextView's default autofill type, so autofill services such as Google's SMS verification codes treated it as a target and could write an OTP into the draft, and long-pressing the empty composer offered Android's "Autofill" action. Report AUTOFILL_TYPE_NONE, as the terminal input already does. That makes View.isAutofillable() false, which keeps the view out of autofill requests and hides the Autofill selection action. IME features (Gboard suggestion and code chips, clipboard, dictation, paste) go through the input connection and are unaffected. The constant is inlined at compile time and the override is never called below API 26, so minSdk 24 is fine. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 10618ce commit 6f99897

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import android.view.Gravity
2020
import android.view.GestureDetector
2121
import android.view.MotionEvent
2222
import android.view.KeyEvent
23+
import android.view.View
2324
import android.view.ViewGroup
2425
import android.view.inputmethod.EditorInfo
2526
import android.view.inputmethod.InputConnection
@@ -584,6 +585,9 @@ internal class SelectionAwareEditText(context: Context) : EditText(context) {
584585
var maxInputChars = Int.MAX_VALUE
585586
var clipboardFragment = ""
586587

588+
// Keeps autofill services such as SMS verification codes from writing into the draft.
589+
override fun getAutofillType(): Int = View.AUTOFILL_TYPE_NONE
590+
587591
/**
588592
* Editable TextView hints do not ellipsize, so long placeholders wrap and grow the composer.
589593
* Truncate the hint to the measured width instead.

0 commit comments

Comments
 (0)