Skip to content

Commit b924e0a

Browse files
authored
fix: message input focus responsiveness (#3202)
* fix: message input focus responsiveness * fix: styles for message input auto complete input
1 parent 315bee7 commit b924e0a

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

package/src/components/AutoCompleteInput/AutoCompleteInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ const AutoCompleteInputWithContext = (props: AutoCompleteInputPropsWithContext)
142142
{
143143
color: black,
144144
maxHeight: (textHeight || 17) * numberOfLines,
145+
paddingHorizontal: command ? 4 : 16,
145146
textAlign: I18nManager.isRTL ? 'right' : 'left',
146147
},
147148
inputBox,
@@ -205,8 +206,7 @@ const styles = StyleSheet.create({
205206
flex: 1,
206207
fontSize: 16,
207208
includeFontPadding: false, // for android vertical text centering
208-
padding: 0, // removal of default text input padding on android
209-
paddingTop: 0, // removal of iOS top padding for weird centering
209+
paddingVertical: 12,
210210
textAlignVertical: 'center', // for android vertical text centering
211211
},
212212
});

package/src/components/MessageInput/AttachmentUploadPreviewList.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ const UnMemoizedAttachmentUploadListPreview = (
185185
}
186186

187187
return (
188-
<View style={[wrapper]}>
188+
<View style={[styles.wrapper, wrapper]}>
189189
{imageUploads.length ? (
190190
<FlatList
191191
data={imageUploads}
@@ -264,10 +264,13 @@ export const AttachmentUploadPreviewList = (props: AttachmentUploadPreviewListPr
264264
const styles = StyleSheet.create({
265265
attachmentSeparator: {
266266
borderBottomWidth: 1,
267-
marginBottom: 10,
267+
marginVertical: 8,
268+
},
269+
filesFlatList: { maxHeight: FILE_PREVIEW_HEIGHT * 2.5 + 16 },
270+
imagesFlatList: {},
271+
wrapper: {
272+
paddingTop: 12,
268273
},
269-
filesFlatList: { marginBottom: 12, maxHeight: FILE_PREVIEW_HEIGHT * 2.5 + 16 },
270-
imagesFlatList: { paddingBottom: 12 },
271274
});
272275

273276
AttachmentUploadPreviewList.displayName =

package/src/components/MessageInput/MessageInput.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ const styles = StyleSheet.create({
7070
autoCompleteInputContainer: {
7171
alignItems: 'center',
7272
flexDirection: 'row',
73-
paddingLeft: 16,
74-
paddingRight: 16,
7573
},
7674
composerContainer: {
7775
alignItems: 'center',
@@ -92,7 +90,7 @@ const styles = StyleSheet.create({
9290
optionsContainer: {
9391
flexDirection: 'row',
9492
},
95-
replyContainer: { paddingBottom: 12, paddingHorizontal: 8 },
93+
replyContainer: { paddingBottom: 0, paddingHorizontal: 8, paddingTop: 8 },
9694
sendButtonContainer: {},
9795
suggestionsListContainer: {
9896
position: 'absolute',
@@ -494,7 +492,6 @@ const MessageInputWithContext = (props: MessageInputPropsWithContext) => {
494492
styles.inputBoxContainer,
495493
{
496494
borderColor: grey_whisper,
497-
paddingVertical: command ? 8 : 12,
498495
},
499496
inputBoxContainer,
500497
isFocused ? focusedInputBoxContainer : null,
@@ -505,6 +502,7 @@ const MessageInputWithContext = (props: MessageInputPropsWithContext) => {
505502
<Reply />
506503
</View>
507504
)}
505+
508506
<AttachmentUploadPreviewList />
509507
{command ? (
510508
<CommandInput disabled={!isOnline} />

package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2135,7 +2135,6 @@ exports[`Thread should match thread snapshot 1`] = `
21352135
},
21362136
{
21372137
"borderColor": "#ECEBEB",
2138-
"paddingVertical": 12,
21392138
},
21402139
{},
21412140
null,
@@ -2148,8 +2147,6 @@ exports[`Thread should match thread snapshot 1`] = `
21482147
{
21492148
"alignItems": "center",
21502149
"flexDirection": "row",
2151-
"paddingLeft": 16,
2152-
"paddingRight": 16,
21532150
},
21542151
{},
21552152
]
@@ -2171,13 +2168,13 @@ exports[`Thread should match thread snapshot 1`] = `
21712168
"flex": 1,
21722169
"fontSize": 16,
21732170
"includeFontPadding": false,
2174-
"padding": 0,
2175-
"paddingTop": 0,
2171+
"paddingVertical": 12,
21762172
"textAlignVertical": "center",
21772173
},
21782174
{
21792175
"color": "#000000",
21802176
"maxHeight": 85,
2177+
"paddingHorizontal": 16,
21812178
"textAlign": "left",
21822179
},
21832180
{},

0 commit comments

Comments
 (0)