Skip to content

Commit 6446eb9

Browse files
authored
fix keyboard blocking input on mentions notifications settings (#8664)
1 parent 9bdaed4 commit 6446eb9

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

app/screens/settings/notification_mention/mention_settings.tsx

+15-11
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import React, {useCallback, useMemo, useState} from 'react';
55
import {useIntl} from 'react-intl';
66
import {Text} from 'react-native';
7+
import {KeyboardAwareScrollView} from 'react-native-keyboard-aware-scroll-view';
78

89
import {updateMe} from '@actions/remote/user';
910
import FloatingTextChipsInput from '@components/floating_text_chips_input';
@@ -34,6 +35,7 @@ const COMMA_KEY = ',';
3435

3536
const getStyleSheet = makeStyleSheetFromTheme((theme) => {
3637
return {
38+
flex: {flex: 1},
3739
input: {
3840
color: theme.centerChannelColor,
3941
paddingHorizontal: 15,
@@ -166,15 +168,8 @@ const MentionSettings = ({componentId, currentUser, isCRTEnabled}: Props) => {
166168

167169
close();
168170
}, [
169-
channelMentionOn,
170-
firstNameMentionOn,
171-
usernameMentionOn,
172-
mentionKeywords,
173-
notifyProps,
174-
mentionProps,
175-
replyNotificationType,
176-
serverUrl,
177-
currentUser,
171+
currentUser, channelMentionOn, replyNotificationType, firstNameMentionOn,
172+
usernameMentionOn, mentionKeywords, mentionProps, close, notifyProps, serverUrl,
178173
]);
179174

180175
const handleFirstNameToggle = useCallback(() => {
@@ -226,7 +221,16 @@ const MentionSettings = ({componentId, currentUser, isCRTEnabled}: Props) => {
226221
useAndroidHardwareBackHandler(componentId, saveMention);
227222

228223
return (
229-
<>
224+
<KeyboardAwareScrollView
225+
bounces={false}
226+
enableAutomaticScroll={true}
227+
enableOnAndroid={true}
228+
keyboardShouldPersistTaps='handled'
229+
keyboardDismissMode='none'
230+
scrollToOverflowEnabled={true}
231+
noPaddingBottomOnAndroid={true}
232+
style={styles.flex}
233+
>
230234
<SettingBlock
231235
headerText={mentionHeaderText}
232236
>
@@ -303,7 +307,7 @@ const MentionSettings = ({componentId, currentUser, isCRTEnabled}: Props) => {
303307
setReplyNotificationType={setReplyNotificationType}
304308
/>
305309
)}
306-
</>
310+
</KeyboardAwareScrollView>
307311
);
308312
};
309313

0 commit comments

Comments
 (0)