From 685adad6b30670ab5c6e65498f9e15e093077ab2 Mon Sep 17 00:00:00 2001 From: dankito Date: Mon, 9 Sep 2024 22:52:13 +0200 Subject: [PATCH] Fixed that loginName got focused even though no bank was selected --- .../net/codinux/banking/ui/dialogs/AddAccountDialog.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 bb6a574..bf4853a 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 @@ -90,9 +90,7 @@ fun AddAccountDialog( showProgressIndicatorOnConfirmButton = isAddingAccount, useMoreThanPlatformDefaultWidthOnMobile = true, onDismiss = { dismiss() }, - onConfirm = { - confirmCalled() - } + onConfirm = { confirmCalled() } ) { Column { @@ -102,7 +100,9 @@ fun AddAccountDialog( onEnteredTextChanged = { enteredBankSearchQuery = it }, onSelectedItemChanged = { selectedBank = it - loginNameFocus.requestFocus() + if (it != null) { + loginNameFocus.requestFocus() + } }, getItemTitle = { bank -> bank.name }, fetchSuggestions = { query -> bankingService.findBanks(query) }