File tree 1 file changed +7
-2
lines changed
src/components/Search/SearchRouter
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
- import React from 'react' ;
2
- import type { StyleProp , ViewStyle } from 'react-native' ;
1
+ import React , { useRef } from 'react' ;
2
+ import type { StyleProp , View , ViewStyle } from 'react-native' ;
3
3
import Icon from '@components/Icon' ;
4
4
import * as Expensicons from '@components/Icon/Expensicons' ;
5
5
import { PressableWithoutFeedback } from '@components/Pressable' ;
@@ -22,14 +22,19 @@ function SearchButton({style}: SearchButtonProps) {
22
22
const theme = useTheme ( ) ;
23
23
const { translate} = useLocalize ( ) ;
24
24
const { openSearchRouter} = useSearchRouterContext ( ) ;
25
+ const pressableRef = useRef < View > ( null ) ;
25
26
26
27
return (
27
28
< Tooltip text = { translate ( 'common.search' ) } >
28
29
< PressableWithoutFeedback
30
+ ref = { pressableRef }
29
31
nativeID = "searchButton"
30
32
accessibilityLabel = { translate ( 'common.search' ) }
31
33
style = { [ styles . flexRow , styles . touchableButtonImage , style ] }
34
+ // eslint-disable-next-line react-compiler/react-compiler
32
35
onPress = { Session . checkIfActionIsAllowed ( ( ) => {
36
+ pressableRef ?. current ?. blur ( ) ;
37
+
33
38
Timing . start ( CONST . TIMING . OPEN_SEARCH ) ;
34
39
Performance . markStart ( CONST . TIMING . OPEN_SEARCH ) ;
35
40
You can’t perform that action at this time.
0 commit comments