11import Badge from '@components/Badge' ;
2- import PressableWithFeedback from '@components/Pressable/PressableWithFeedback ' ;
2+ import PressableWithSecondaryInteraction from '@components/PressableWithSecondaryInteraction ' ;
33import Tooltip from '@components/Tooltip' ;
44
55import useNetwork from '@hooks/useNetwork' ;
@@ -17,7 +17,10 @@ import TabIcon from './TabIcon';
1717import TabLabel from './TabLabel' ;
1818import { useTabSelectorActions } from './TabSelectorContext' ;
1919
20- const AnimatedPressableWithFeedback = Animated . createAnimatedComponent ( PressableWithFeedback ) ;
20+ // Use PressableWithSecondaryInteraction so the tab responds to both a long-press (touch) and a
21+ // right-click / context-menu (web). PressableWithFeedback's onLongPress alone never fires on a
22+ // right-click, so the desktop-web menu could not be opened.
23+ const AnimatedPressableWithSecondaryInteraction = Animated . createAnimatedComponent ( PressableWithSecondaryInteraction ) ;
2124
2225type TabSelectorItemProps = BaseTabSelectorItemProps ;
2326
@@ -55,7 +58,7 @@ function TabSelectorItem({
5558 const shouldTextHaveStrikeThrough = isOffline && pendingAction === CONST . RED_BRICK_ROAD_PENDING_ACTION . DELETE ;
5659
5760 const children = (
58- < AnimatedPressableWithFeedback
61+ < AnimatedPressableWithSecondaryInteraction
5962 accessibilityLabel = { title }
6063 accessibilityState = { accessibilityState }
6164 accessibilityRole = { CONST . ROLE . TAB }
@@ -66,7 +69,7 @@ function TabSelectorItem({
6669 isOfflineWithPendingAction ? styles . offlineFeedbackPending : undefined ,
6770 ] }
6871 wrapperStyle = { equalWidth ? styles . flex1 : styles . flexGrow1 }
69- onLongPress = { onLongPress }
72+ onSecondaryInteraction = { onLongPress }
7073 onPress = { ( ) => {
7174 scrollToTab ( tabKey ) ;
7275 onPress ( ) ;
@@ -102,7 +105,7 @@ function TabSelectorItem({
102105 badgeStyles = { badgeStyles }
103106 />
104107 ) }
105- </ AnimatedPressableWithFeedback >
108+ </ AnimatedPressableWithSecondaryInteraction >
106109 ) ;
107110
108111 return (
0 commit comments