From 2ba1b52a800250c9d4736d67b393349e4a8de43e Mon Sep 17 00:00:00 2001 From: dankito Date: Thu, 26 Sep 2024 06:37:54 +0200 Subject: [PATCH] Passing onEnterPressed on to TextField --- .../net/codinux/banking/ui/forms/AutocompleteTextField.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/forms/AutocompleteTextField.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/forms/AutocompleteTextField.kt index 9024326..0a14086 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/forms/AutocompleteTextField.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/forms/AutocompleteTextField.kt @@ -30,6 +30,7 @@ fun AutocompleteTextField( modifier: Modifier = Modifier, textFieldFocus: FocusRequester = remember { FocusRequester() }, keyboardOptions: KeyboardOptions = KeyboardOptions.Default, + onEnterPressed: (() -> Unit)? = null, leadingIcon: @Composable (() -> Unit)? = null, fetchSuggestions: suspend (query: String) -> Collection = { emptyList() }, suggestionContent: @Composable (T) -> Unit @@ -102,7 +103,8 @@ fun AutocompleteTextField( ) } }, - leadingIcon = leadingIcon + leadingIcon = leadingIcon, + onEnterPressed = onEnterPressed ) // due to a bug (still not fixed since 2021) in ExposedDropdownMenu its popup has a maximum width of 800 pixel / 320dp which is too less to fit