Skip to content

Commit f1405b9

Browse files
committed
fix: current active menu button not getting announced in settings profile page
1 parent 1071d10 commit f1405b9

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/components/MenuItem.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,9 @@ type MenuItemBaseProps = ForwardedFSClassProps &
420420
/** Whether the screen containing the item is focused */
421421
isFocused?: boolean;
422422

423+
/** Whether the item is selected */
424+
selected?: boolean;
425+
423426
/** Additional styles for the root wrapper View */
424427
rootWrapperStyle?: StyleProp<ViewStyle>;
425428

@@ -576,6 +579,7 @@ function MenuItem({
576579
forwardedFSClass,
577580
ref,
578581
isFocused,
582+
selected = false,
579583
sentryLabel,
580584
rootWrapperStyle,
581585
role = CONST.ROLE.BUTTON,
@@ -797,6 +801,7 @@ function MenuItem({
797801
role={interactive ? role : undefined}
798802
accessibilityLabel={`${enhancedAccessibilityLabel}${brickRoadIndicator ? `. ${translate('common.yourReviewIsRequired')}` : ''}`}
799803
accessible={shouldBeAccessible}
804+
accessibilityState={{selected}}
800805
tabIndex={interactive ? tabIndex : -1}
801806
onFocus={onFocus}
802807
sentryLabel={sentryLabel}

src/pages/settings/InitialSettingsPage.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,8 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr
470470
shouldBlockSelection={!!item.link}
471471
onSecondaryInteraction={item.link ? (event) => openPopover(item.link, event) : undefined}
472472
focused={isFocused}
473+
selected={isFocused}
474+
role={CONST.ROLE.TAB}
473475
isPaneMenu
474476
sentryLabel={item.sentryLabel}
475477
iconRight={item.iconRight}

0 commit comments

Comments
 (0)