Skip to content

Instantly share code, notes, and snippets.

@wavecos
Last active March 21, 2023 14:07
Show Gist options
  • Save wavecos/c992e398e87100ee05ff6dbc83764aa7 to your computer and use it in GitHub Desktop.
Save wavecos/c992e398e87100ee05ff6dbc83764aa7 to your computer and use it in GitHub Desktop.
Dismiss keyboard when touch outside #android #dismiss #keyboard #compose

Dismiss keyboard in Android

reference

val localFocusManager = LocalFocusManager.current

...

        Box(
            modifier = Modifier
                .fillMaxSize()
                .pointerInput(Unit) {
                    detectTapGestures(onTap = {
                        localFocusManager.clearFocus()
                    })
                }
        ) { .. }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment