File tree 1 file changed +9
-4
lines changed 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 1
- import React , { useMemo } from 'react' ;
1
+ import React , { useMemo , useRef } from 'react' ;
2
+ import type { View } from 'react-native' ;
2
3
import type { OnyxEntry } from 'react-native-onyx' ;
3
4
import useLocalize from '@hooks/useLocalize' ;
4
5
import useTheme from '@hooks/useTheme' ;
@@ -23,6 +24,8 @@ function WorkspaceSwitcherButton({policy}: WorkspaceSwitcherButtonProps) {
23
24
const { translate} = useLocalize ( ) ;
24
25
const theme = useTheme ( ) ;
25
26
27
+ const pressableRef = useRef < HTMLDivElement | View | null > ( null ) ;
28
+
26
29
const { source, name, type} = useMemo ( ( ) => {
27
30
if ( ! policy ) {
28
31
return { source : Expensicons . ExpensifyAppIcon , name : CONST . WORKSPACE_SWITCHER . NAME , type : CONST . ICON_TYPE_AVATAR } ;
@@ -39,14 +42,16 @@ function WorkspaceSwitcherButton({policy}: WorkspaceSwitcherButtonProps) {
39
42
return (
40
43
< Tooltip text = { translate ( 'workspace.switcher.headerTitle' ) } >
41
44
< PressableWithFeedback
45
+ ref = { pressableRef }
42
46
accessibilityRole = { CONST . ROLE . BUTTON }
43
47
accessibilityLabel = { translate ( 'common.workspaces' ) }
44
48
accessible
45
- onPress = { ( ) =>
49
+ onPress = { ( ) => {
50
+ pressableRef ?. current ?. blur ( ) ;
46
51
interceptAnonymousUser ( ( ) => {
47
52
Navigation . navigate ( ROUTES . WORKSPACE_SWITCHER ) ;
48
- } )
49
- }
53
+ } ) ;
54
+ } }
50
55
>
51
56
{ ( { hovered} ) => (
52
57
< SubscriptAvatar
You can’t perform that action at this time.
0 commit comments