Skip to content

Commit 11a4b74

Browse files
committed
fix(mobile): Android terminal input no longer triggers password autofill
The terminal's hidden EditText uses the visible-password input type, so autofill services treated it as a login field and engaged on every focus. Opting out with importantForAutofill is not enough: with trigger_fill_request_on_unimportant_view, Android still sends a fill request for unimportant EditTexts. Report AUTOFILL_TYPE_NONE instead, the first check isAutofillable() runs on every version. The input type stays, so keyboard behavior does not change. Closes #12755
1 parent 17e1087 commit 11a4b74

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

  • apps/mobile/modules/t3-terminal/android/src/main/java/expo/modules/t3terminal

‎apps/mobile/modules/t3-terminal/android/src/main/java/expo/modules/t3terminal/T3TerminalView.kt‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import android.text.Editable
77
import android.text.InputType
88
import android.text.TextWatcher
99
import android.view.KeyEvent
10+
import android.view.View
1011
import android.view.ViewGroup
1112
import android.view.inputmethod.EditorInfo
1213
import android.view.inputmethod.InputMethodManager
@@ -20,7 +21,13 @@ import kotlin.math.max
2021
class T3TerminalView(context: Context, appContext: AppContext) : ExpoView(context, appContext) {
2122
private val container = FrameLayout(context)
2223
private val terminalCanvas = TerminalCanvasView(context)
23-
private val inputView = EditText(context)
24+
25+
// Autofill services read the visible-password input below as a login field. Newer Android
26+
// versions also send fill requests for views that opt out with importantForAutofill, so
27+
// report no autofill type, the one check every version runs first.
28+
private val inputView = object : EditText(context) {
29+
override fun getAutofillType() = View.AUTOFILL_TYPE_NONE
30+
}
2431
private val onInput by EventDispatcher()
2532
private val onResize by EventDispatcher()
2633
private val onCapture by EventDispatcher()

0 commit comments

Comments
 (0)