Skip to content

Commit 75bfd4f

Browse files
committed
Add touchable handler to main app list
1 parent 3fc064a commit 75bfd4f

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/widgets/search.widget.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@ import {LoadingBar} from 'components/LoadingBar'
66
import {MainInput} from 'components/MainInput'
77
import {observer} from 'mobx-react-lite'
88
import React, {FC, useEffect, useRef} from 'react'
9-
import {FlatList, Image, Platform, Text, View, ViewStyle} from 'react-native'
9+
import {
10+
FlatList,
11+
Image,
12+
Platform,
13+
Text,
14+
TouchableOpacity,
15+
View,
16+
ViewStyle,
17+
} from 'react-native'
1018
import {useStore} from 'store'
1119
import {ItemType, Widget} from 'stores/ui.store'
1220

@@ -53,7 +61,11 @@ export const SearchWidget: FC<Props> = observer(() => {
5361
}
5462

5563
return (
56-
<View
64+
<TouchableOpacity
65+
onPress={() => {
66+
store.ui.setSelectedIndex(index)
67+
store.keystroke.simulateEnter()
68+
}}
5769
className={clsx('flex-row items-center rounded-lg py-1 border', {
5870
'bg-accent': isActive,
5971
'border-accent': isActive,
@@ -126,7 +138,7 @@ export const SearchWidget: FC<Props> = observer(() => {
126138
</View>
127139
)}
128140
</View>
129-
</View>
141+
</TouchableOpacity>
130142
)
131143
}
132144

0 commit comments

Comments
 (0)