Hi! Is there an option on `TextField` to prevent s...
# compose
z
Hi! Is there an option on
TextField
to prevent showing soft input similar to
showSoftInputOnFocus
on
EditText
?
f
Hacky, but kind of works:
Copy code
modifier = Modifier.onFocusEvent {
    keyboardCtrl?.hide()
},
With
keyboardCtrl = LocalSoftwareKeyboardController.current
There is also the
LocalTextInputService
composition local, which is used by the text field to show the software keyboard. Unfortunately, the relevant method
showSoftwareKeyboard
of
TextInputService
cannot be overridden to not show the software keyboard.
z
Thanks! Couldn't done with focusEvent and controller, so implemented that with
WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM