diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/AddAccountDialog.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/AddAccountDialog.kt index bf4853a..542d0c2 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/AddAccountDialog.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/AddAccountDialog.kt @@ -45,6 +45,8 @@ fun AddAccountDialog( val disabledColor: Color = MaterialTheme.colors.onSurface.copy(ContentAlpha.disabled) + val bankAutocompleteFocus = remember { FocusRequester() } + val loginNameFocus = remember { FocusRequester() } var isAddingAccount by remember { mutableStateOf(false) } @@ -97,6 +99,7 @@ fun AddAccountDialog( AutocompleteTextField( label = "Bank (Suche mit Name, Ort, BIC oder Bankleitzahl)", value = enteredBankSearchQuery, + textFieldFocus = bankAutocompleteFocus, onEnteredTextChanged = { enteredBankSearchQuery = it }, onSelectedItemChanged = { selectedBank = it @@ -166,4 +169,9 @@ fun AddAccountDialog( } } } + + + LaunchedEffect(bankAutocompleteFocus) { + bankAutocompleteFocus.requestFocus() + } } \ No newline at end of file