Skip to content

Commit 2dfe23b

Browse files
authored
Merge pull request Expensify#85193 from Burhan-Rashid/fix/75556
fix: current active menu button not getting announced in settings profile page
2 parents 84941ed + 34fb1d2 commit 2dfe23b

5 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/components/MenuItem.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,7 @@ function MenuItem({
797797
role={interactive ? role : undefined}
798798
accessibilityLabel={`${enhancedAccessibilityLabel}${brickRoadIndicator ? `. ${translate('common.yourReviewIsRequired')}` : ''}`}
799799
accessible={shouldBeAccessible}
800+
accessibilityState={role === CONST.ROLE.TAB ? {selected: focused} : undefined}
800801
tabIndex={interactive ? tabIndex : -1}
801802
onFocus={onFocus}
802803
sentryLabel={sentryLabel}

src/pages/Search/SavedSearchList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ function SavedSearchList({hash}: SavedSearchListProps) {
8686

8787
return {
8888
...baseMenuItem,
89+
role: CONST.ROLE.TAB,
8990
sentryLabel: CONST.SENTRY_LABEL.SEARCH.SAVED_SEARCH_MENU_ITEM,
9091
onPress: () => {
9192
setSearchContext(false);

src/pages/Search/SearchTypeMenuItem.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ function SearchTypeMenuItem({title, icon, badgeText, focused = false, onPress}:
4141
<PressableWithoutFeedback
4242
onPress={onPress}
4343
accessibilityLabel={title}
44-
role={CONST.ROLE.BUTTON}
44+
accessibilityState={{selected: focused}}
45+
role={CONST.ROLE.TAB}
4546
sentryLabel={CONST.SENTRY_LABEL.SEARCH.TYPE_MENU_ITEM}
4647
style={({hovered, pressed}) => [
4748
styles.flexRow,

src/pages/settings/InitialSettingsPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr
470470
shouldBlockSelection={!!item.link}
471471
onSecondaryInteraction={item.link ? (event) => openPopover(item.link, event) : undefined}
472472
focused={isFocused}
473+
role={CONST.ROLE.TAB}
473474
isPaneMenu
474475
sentryLabel={item.sentryLabel}
475476
iconRight={item.iconRight}

src/pages/workspace/WorkspaceInitialPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@ function WorkspaceInitialPage({policyDraft, policy: policyProp, route}: Workspac
478478
wrapperStyle={styles.sectionMenuItem(shouldUseNarrowLayout)}
479479
highlighted={!!item?.highlighted}
480480
focused={!!(item.screenName && activeRoute?.startsWith(item.screenName))}
481+
role={CONST.ROLE.TAB}
481482
badgeText={item.badgeText}
482483
shouldIconUseAutoWidthStyle
483484
sentryLabel={item.sentryLabel}

0 commit comments

Comments
 (0)