-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Description
When using ExposedDropdownMenuBox with DropdownMenuItem, TalkBack announces menu items as "unlabelled" instead of reading the item text.
Expected behavior: TalkBack should announce the item text (e.g. "Cranberry") when focusing on a DropdownMenuItem.
Source code:
ExposedDropdownMenuBox(
expanded = expanded,
onExpandedChange = { expanded = it }
) {
OutlinedTextField(
modifier = Modifier.menuAnchor(ExposedDropdownMenuAnchorType.PrimaryNotEditable),
value = selectedItem,
onValueChange = {},
readOnly = true,
label = { Text("Select a fruit") },
trailingIcon = { ExposedDropdownMenuDefaults.TrailingIcon(expanded = expanded) }
)
DropdownMenu(
modifier = Modifier.exposedDropdownSize(),
expanded = expanded,
onDismissRequest = { expanded = false }
) {
items.forEach { item ->
DropdownMenuItem(
text = { Text(item) },
onClick = {
selectedItem = item
expanded = false
},
contentPadding = ExposedDropdownMenuDefaults.ItemContentPadding
)
}
}
}
Minimal sample app repro: https://github.com/alpertign/ExposedDropdownMenuBoxIssueA
Android API version: Android 14
Material Library version: BOM 2024.12.01 (Material3 1.3.1)
Device: Xiaomi (with TalkBack enabled)