Skip to content

Commit 8dd5a81

Browse files
Material Design Teamdrchen
authored andcommitted
[Menu][A11y] Make context menu TextView focusable on Menu demo screen
This allows keyboard users to navigate to the TextView and trigger the context menu using the keyboard, improving accessibility within the demo. PiperOrigin-RevId: 800382654
1 parent 9e1c68d commit 8dd5a81

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

catalog/java/io/material/catalog/menu/res/layout/cat_menu_fragment.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
android:layout_width="match_parent"
105105
android:layout_height="wrap_content"
106106
android:padding="16dp"
107+
android:focusable="true"
107108
android:text="@string/menu_context_menu_description"/>
108109

109110
</LinearLayout>

catalog/java/io/material/catalog/menu/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</string>
3232

3333
<string name="menu_context_menu_description" description="Text explaining how to use context menus [CHAR_LIMIT=NONE].">
34-
This TextView opens a context menu when long pressed.
34+
This TextView opens a context menu when long pressed or by pressing Enter on a keyboard.
3535
\n\nIt provides actions that affect the selected content or context frame.
3636
</string>
3737
<string name="context_menu_highlight" description="text for a menu option to highlight text [CHAR_LIMIT=20].">Highlight</string>

0 commit comments

Comments
 (0)