Skip to content

Commit 5b2d4d6

Browse files
afohrmancketcham
authored andcommitted
Allow bottom nav items to gain focus on keyboard traversal.
Set the bottom nav items to always be focusable. This addresses a bug in which bottom nav items didn't gain focus by keyboard pre-O. PiperOrigin-RevId: 204518309
1 parent 91da445 commit 5b2d4d6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/java/com/google/android/material/bottomnavigation/BottomNavigationItemView.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ public BottomNavigationItemView(Context context, AttributeSet attrs, int defStyl
9292
// the content description of the BottomNavigationItemView should be used for accessibility.
9393
ViewCompat.setImportantForAccessibility(smallLabel, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_NO);
9494
ViewCompat.setImportantForAccessibility(largeLabel, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_NO);
95+
setFocusable(true);
9596
calculateTextScaleFactors(smallLabel.getTextSize(), largeLabel.getTextSize());
9697
}
9798

0 commit comments

Comments
 (0)