What is the current way to disable the Soft Keyboa...
# compose-ios
l
What is the current way to disable the Soft Keyboard on 1.7.0-beta02?
InterceptPlatformTextInput
does not seem to work yet.
After a while of trying out stuff, this is my current solution:
Copy code
CompositionLocalProvider(
            LocalTextInputService provides EmptyTextInputService,
        ) {
            InterceptPlatformTextInput(
                interceptor = { request, nextHandler ->
                    awaitCancellation()
                }
            ) {
                TextField()
            }
        }

val EmptyTextInputService = TextInputService(object : PlatformTextInputService {
    override fun hideSoftwareKeyboard() {
    }

    override fun showSoftwareKeyboard() {
    }

    override fun startInput(
        value: TextFieldValue,
        imeOptions: ImeOptions,
        onEditCommand: (List<EditCommand>) -> Unit,
        onImeActionPerformed: (ImeAction) -> Unit
    ) {
    }

    override fun stopInput() {
    }

    override fun updateState(oldValue: TextFieldValue?, newValue: TextFieldValue) {
    }
})
e
With 1.7.0 seems that
InterceptPlatformTextInput
works for Android and
EmptyTextInputService
is required to get the same result for iOS.