Always use the latest... fix.

This commit is contained in:
Benoit Marty 2024-01-23 18:13:02 +01:00 committed by Benoit Marty
parent 3ced570b3c
commit eb51b49aef
9 changed files with 49 additions and 19 deletions

View file

@ -43,8 +43,9 @@ internal fun <T> SoftKeyboardEffect(
) {
val view = LocalView.current
val latestOnRequestFocus by rememberUpdatedState(onRequestFocus)
LaunchedEffect(key, predicate) {
if (predicate(key)) {
val latestPredicate by rememberUpdatedState(predicate)
LaunchedEffect(key) {
if (latestPredicate(key)) {
// Await window focus in case returning from a dialog
view.awaitWindowFocus()