Skip to content

fix(fab): drop collapsed FAB.Menu items from the Android focus order - #5356

Open
akysil wants to merge 1 commit into
callstack:mainfrom
akysil:fix/5343-fab-menu-on-android-with-a-hardware-keyb
Open

akysil wants to merge 1 commit into
callstack:mainfrom
akysil:fix/5343-fab-menu-on-android-with-a-hardware-keyb

Conversation

@akysil

@akysil akysil commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Motivation

With a hardware keyboard on Android, Tab stopped on a closed FAB.Menu's invisible items before it reached the trigger. While the menu is closed, its items and their scroll container are now out of the keyboard focus order, so Tab goes straight to the trigger.

Related issue

Fixes #5343

Screenshots / Videos

No rendering change: the collapsed items draw nothing either way. Only the Tab stops on them go away.

Test plan

In the example app on an Android emulator (API 36) with keyboard key events, FAB example in Menu mode:

  1. Menu closed, press Tab until focus reaches the FAB: it lands on the trigger. On main it first stops three times on invisible views at the item positions.
  2. Open the menu and press Shift+Tab: Favorite, Remind me and Send are reached, as on main.
  3. Close the menu and press Tab again: focus goes straight to the trigger.

On Android, `focusable={false}` doesn't stop a view from taking keyboard
focus while it is `accessible`, and `Pressable` is accessible by default,
so a closed FAB.Menu's items were Tab stops on views that draw nothing.
They are now not accessible while collapsed. On Android their scroll view
doesn't scroll while collapsed either: Android focuses a scrollable view
itself when none of its children can take focus.

This branch has not been deployed

No deployments
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.

FAB.Menu: on Android with a hardware keyboard, a closed menu's items are still Tab stops

1 participant