Skip to content

feat: getByLabel finds jetpack compose text fields by their floating label - #417

Merged
gmegidish merged 4 commits into
feat/compose-button-rolefrom
feat/compose-textfield-label
Oct 18, 2026
Merged

gmegidish merged 4 commits into
feat/compose-button-rolefrom
feat/compose-textfield-label

Conversation

@gmegidish

Copy link
Copy Markdown
Member

Summary

  • A text field with no label of its own is now labelled by its children. That is where a Jetpack Compose TextField / OutlinedTextField keeps its floating label: Compose reports label = { Text("Display name") } as a child TextView of the EditText.
  • So getByLabel('Display name') finds the field, and getByRole('textfield', { name: 'Phone' }) names an empty field by its label.
  • Only text fields get this fallback, so a container's child text never becomes its label.

Stacked on #416, and reuses its accessibleName.

Test plan

  • npm run build, npm test (967 passed), npm run lint
  • New query-engine tests: exact and partial floating labels, a non-text-field container isn't labelled by its child, an empty field named by its label
  • Milliways conformance on an Android emulator: getByLabel › matches a text field by its label and getByRole › finds text fields now pass. On the iOS simulator the same tests still pass (22 of 22).

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 92e34def-b8c0-41c2-94d8-3a4323af40ca

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@gmegidish
gmegidish force-pushed the feat/compose-textfield-label branch 2 times, most recently from f354b19 to b45a1e2 Compare October 16, 2026 19:01
@gmegidish
gmegidish force-pushed the feat/compose-textfield-label branch from f6a4228 to 266fd02 Compare October 17, 2026 20:05
@gmegidish
gmegidish merged commit 08ea2e0 into feat/compose-button-role Oct 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant