Skip to content

[ExposedDropdownMenuBox] DropdownMenuItem items announced as "unlabelled" by TalkBack #5012

@alp-well

Description

@alp-well

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)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions