Passing onEnterPressed on to TextField

This commit is contained in:
dankito 2024-09-26 06:37:54 +02:00
parent 1970eff09a
commit 2ba1b52a80
1 changed files with 3 additions and 1 deletions

View File

@ -30,6 +30,7 @@ fun <T> AutocompleteTextField(
modifier: Modifier = Modifier,
textFieldFocus: FocusRequester = remember { FocusRequester() },
keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
onEnterPressed: (() -> Unit)? = null,
leadingIcon: @Composable (() -> Unit)? = null,
fetchSuggestions: suspend (query: String) -> Collection<T> = { emptyList() },
suggestionContent: @Composable (T) -> Unit
@ -102,7 +103,8 @@ fun <T> 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