Skip to content

Commit 7426080

Browse files
committedApr 11, 2024
fix: Title field doesn't get auto focused on screen launch
1 parent 0a2a694 commit 7426080

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎common/src/commonMain/kotlin/com/artemchep/keyguard/feature/add/AddScreenScope.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import androidx.compose.runtime.getValue
66
import androidx.compose.runtime.mutableStateOf
77
import androidx.compose.runtime.remember
88
import androidx.compose.runtime.setValue
9-
import androidx.compose.ui.focus.FocusRequester
109
import com.artemchep.keyguard.ui.focus.FocusRequester2
10+
import kotlinx.coroutines.delay
1111

1212
class AddScreenScope(
1313
initialFocusRequested: Boolean = false,
@@ -22,6 +22,7 @@ class AddScreenScope(
2222
LaunchedEffect(focusRequester) {
2323
var initialFocusRequested by initialFocusRequestedState
2424
if (!initialFocusRequested) {
25+
delay(100L)
2526
focusRequester.requestFocus()
2627
// do not request it the second time
2728
initialFocusRequested = true

0 commit comments

Comments
 (0)
Please sign in to comment.