Skip to content

Commit 629c87e

Browse files
committed
fixed PR comments and added changes for reports page and workspaceInitialPage
1 parent a484805 commit 629c87e

4 files changed

Lines changed: 4 additions & 7 deletions

File tree

src/components/MenuItem.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -420,9 +420,6 @@ 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-
426423
/** Additional styles for the root wrapper View */
427424
rootWrapperStyle?: StyleProp<ViewStyle>;
428425

@@ -579,7 +576,6 @@ function MenuItem({
579576
forwardedFSClass,
580577
ref,
581578
isFocused,
582-
selected,
583579
sentryLabel,
584580
rootWrapperStyle,
585581
role = CONST.ROLE.BUTTON,
@@ -801,7 +797,7 @@ function MenuItem({
801797
role={interactive ? role : undefined}
802798
accessibilityLabel={`${enhancedAccessibilityLabel}${brickRoadIndicator ? `. ${translate('common.yourReviewIsRequired')}` : ''}`}
803799
accessible={shouldBeAccessible}
804-
accessibilityState={{selected}}
800+
accessibilityState={role === CONST.ROLE.TAB ? {selected: focused} : undefined}
805801
tabIndex={interactive ? tabIndex : -1}
806802
onFocus={onFocus}
807803
sentryLabel={sentryLabel}

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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,6 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr
470470
shouldBlockSelection={!!item.link}
471471
onSecondaryInteraction={item.link ? (event) => openPopover(item.link, event) : undefined}
472472
focused={isFocused}
473-
selected={isFocused}
474473
role={CONST.ROLE.TAB}
475474
isPaneMenu
476475
sentryLabel={item.sentryLabel}

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)