Jack Wilsdon
05/27/2025, 8:25 PMExposedDropdownMenuBox
using just the keyboard? I'm using it like this (simplified):
ExposedDropdownMenuBox(expanded = expanded, onExpandedChange = { if (enabled) {expanded = it }}) {
OutlinedTextField(
value = dropdownValue,
onValueChange = {},
modifier = Modifier.menuAnchor(ExposedDropdownMenuAnchorType.PrimaryNotEditable),
enabled = enabled,
readOnly = true,
label = { stringResource(R.string.dropdown_name) },
trailingIcon = { ExposedDropdownMenuDefaults.TrailingIcon(expanded = expanded) },
colors = ExposedDropdownMenuDefaults.outlinedTextFieldColors(),
)
ExposedDropdownMenu(expanded = expanded, onDismissRequest = { expanded = false }) {
dropdownItems.forEach {
DropdownMenuItem(
text = { Text(it) },
onClick = {
dropdownValue = it
expanded = false
},
contentPadding = ExposedDropdownMenuDefaults.ItemContentPadding,
)
}
}
}
But there doesn't seem to be any way to open the dropdown using just the keyboard - I can focus the field but no keys will open the dropdown (tapping it does open it).