Hi! I’m trying to implement keyboard closure when ...
# compose
r
Hi! I’m trying to implement keyboard closure when user is scrolling outside the keyboard, but I’m not able to write something (keyboard is opened and immediately closed) if I check
rememberScrollState().isScrollInProgress
value and execute
LocalFocusManager.current.clearFocus()
when scroll is in progress. What’s the recommended way to handle keyboard closure in this situation?
1
My solution:
Copy code
LaunchedEffect(Unit) {
            snapshotFlow { scrollState.value }.collect {
                focusManager.clearFocus()
            }
        }
b
Thank you! this works well
🙌 1