about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorOllie H <renahlee@outlook.com>2023-05-15 11:12:38 -0700
committerGitHub <noreply@github.com>2023-05-15 13:12:38 -0500
commit841ad692d3b3b57d0a810201139af965200e0b9a (patch)
treed2685b765fc54f954dd69ff7c5f178af1df4fca3 /src
parent5f074a21c9a2fc8f6f65defd0a4c2a6c7f7e2153 (diff)
downloadvoidsky-841ad692d3b3b57d0a810201139af965200e0b9a.tar.zst
Make autocomplete pressable (#620)
Diffstat (limited to 'src')
-rw-r--r--src/view/com/composer/text-input/web/Autocomplete.tsx12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/view/com/composer/text-input/web/Autocomplete.tsx b/src/view/com/composer/text-input/web/Autocomplete.tsx
index 475ec119b..87820b97b 100644
--- a/src/view/com/composer/text-input/web/Autocomplete.tsx
+++ b/src/view/com/composer/text-input/web/Autocomplete.tsx
@@ -4,7 +4,7 @@ import React, {
   useImperativeHandle,
   useState,
 } from 'react'
-import {StyleSheet, View} from 'react-native'
+import {Pressable, StyleSheet, View} from 'react-native'
 import {ReactRenderer} from '@tiptap/react'
 import tippy, {Instance as TippyInstance} from 'tippy.js'
 import {
@@ -158,7 +158,7 @@ const MentionList = forwardRef<MentionListRef, SuggestionProps>(
               const isSelected = selectedIndex === index
 
               return (
-                <View
+                <Pressable
                   key={item.handle}
                   style={[
                     isSelected ? pal.viewLight : undefined,
@@ -169,7 +169,11 @@ const MentionList = forwardRef<MentionListRef, SuggestionProps>(
                       : index === items.length - 1
                       ? styles.lastMention
                       : undefined,
-                  ]}>
+                  ]}
+                  onPress={() => {
+                    selectItem(index)
+                  }}
+                  accessibilityRole="button">
                   <View style={styles.avatarAndDisplayName}>
                     <UserAvatar avatar={item.avatar ?? null} size={26} />
                     <Text style={pal.text} numberOfLines={1}>
@@ -179,7 +183,7 @@ const MentionList = forwardRef<MentionListRef, SuggestionProps>(
                   <Text type="xs" style={pal.textLight} numberOfLines={1}>
                     @{item.handle}
                   </Text>
-                </View>
+                </Pressable>
               )
             })
           ) : (