Skip to content

Commit 24fcb29

Browse files
committed
add hitslop to attach buttons
1 parent 239c418 commit 24fcb29

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

src/components/AttachmentPicker/components/AttachmentSelectionBar.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ export const AttachmentSelectionBar: React.FC = () => {
7575
{ height: attachmentSelectionBarHeight ?? 52 },
7676
]}
7777
>
78-
<TouchableOpacity onPress={() => setPicker('images')}>
78+
<TouchableOpacity
79+
hitSlop={{ bottom: 15, top: 15 }}
80+
onPress={() => setPicker('images')}
81+
>
7982
<View style={[styles.icon, icon]}>
8083
<ImageSelectorIcon
8184
numberOfImageUploads={imageUploads.length}
@@ -86,6 +89,7 @@ export const AttachmentSelectionBar: React.FC = () => {
8689
{hasFilePicker && (
8790
<TouchableOpacity
8891
disabled={imageUploads.length > 0}
92+
hitSlop={{ bottom: 15, top: 15 }}
8993
onPress={openFilePicker}
9094
>
9195
<View style={[styles.icon, icon]}>
@@ -96,7 +100,10 @@ export const AttachmentSelectionBar: React.FC = () => {
96100
</View>
97101
</TouchableOpacity>
98102
)}
99-
<TouchableOpacity onPress={takeAndUploadImage}>
103+
<TouchableOpacity
104+
hitSlop={{ bottom: 15, top: 15 }}
105+
onPress={takeAndUploadImage}
106+
>
100107
<View style={[styles.icon, icon]}>
101108
<CameraSelectorIcon
102109
numberOfImageUploads={imageUploads.length}

src/components/MessageInput/AttachButton.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ const AttachButtonWithContext = <
5858
return (
5959
<TouchableOpacity
6060
disabled={disabled}
61+
hitSlop={{ bottom: 15, left: 15, right: 5, top: 15 }}
6162
onPress={handleOnPress}
6263
style={[attachButton]}
6364
testID='attach-button'

src/components/MessageInput/CommandsButton.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export const CommandsButtonWithContext = <
6363
return (
6464
<TouchableOpacity
6565
disabled={disabled}
66+
hitSlop={{ bottom: 15, left: 5, right: 15, top: 15 }}
6667
onPress={handleOnPress}
6768
style={[commandsButton]}
6869
testID='commands-button'

src/components/MessageInput/MoreOptionsButton.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ const MoreOptionsButtonWithContext = <
5757
return (
5858
<TouchableOpacity
5959
disabled={disabled}
60+
hitSlop={{ bottom: 15, left: 15, right: 15, top: 15 }}
6061
onPress={handleOnPress}
6162
style={[moreOptionsButton]}
6263
testID='more-options-button'

0 commit comments

Comments
 (0)