Focusing bank autocomplete box on start

This commit is contained in:
dankito 2024-09-09 23:04:21 +02:00
parent 025b91d318
commit 8d79bfc15d
1 changed files with 8 additions and 0 deletions

View File

@ -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()
}
}