Removed the delay and requestFocus() as it suddenly works without
This commit is contained in:
parent
c80d75c409
commit
40ae222dfc
|
@ -39,8 +39,6 @@ fun <T> AutocompleteTextFieldNew(
|
|||
var suggestionsFetchJob: Job? = null
|
||||
|
||||
val textFieldFocus = remember { FocusRequester() }
|
||||
val keyboardController = LocalSoftwareKeyboardController.current
|
||||
val interactionSource = remember { MutableInteractionSource() }
|
||||
|
||||
val coroutineScope = rememberCoroutineScope()
|
||||
|
||||
|
@ -57,11 +55,6 @@ fun <T> AutocompleteTextFieldNew(
|
|||
if (expanded == false && suggestions.isNotEmpty()) {
|
||||
expanded = true
|
||||
}
|
||||
|
||||
// Delay to ensure menu is fully displayed before requesting focus
|
||||
delay(100)
|
||||
textFieldFocus.requestFocus() // Request focus back to TextField
|
||||
keyboardController?.show()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,7 +79,6 @@ fun <T> AutocompleteTextFieldNew(
|
|||
fetchSuggestionsAsync()
|
||||
}
|
||||
},
|
||||
interactionSource = interactionSource,
|
||||
label = { Text(label) },
|
||||
maxLines = 1,
|
||||
trailingIcon = {
|
||||
|
|
Loading…
Reference in New Issue