Browse Source

FIX | Fix android: focus input field after select user to mention

merge-requests/293/head
Oksana Stepanenko 3 years ago
parent
commit
287c1584df
  1. 2
      src/modules/chats/transforms/chat-messages.transforms.ts
  2. 6
      src/shared/components/plugins/chat/chat-bar.component.tsx

2
src/modules/chats/transforms/chat-messages.transforms.ts

@ -70,7 +70,7 @@ const getDeleteMemberMessage = ( @@ -70,7 +70,7 @@ const getDeleteMemberMessage = (
return `${name} видалив ${deletedUserName} з чату`
}
return `${name} покинув чат`
return `${name} покидає чат`
}
const getNewChatMessage = (item: IMessageInChat) => {

6
src/shared/components/plugins/chat/chat-bar.component.tsx

@ -2,12 +2,11 @@ import { $size, isAndroid } from '@/shared/helpers' @@ -2,12 +2,11 @@ import { $size, isAndroid } from '@/shared/helpers'
import { useTheme } from '@/shared/hooks'
import { PartialTheme } from '@/shared/themes/interfaces'
import _ from 'lodash'
import React, { FC, useEffect, useMemo, useRef, useState } from 'react'
import React, { FC, useMemo, useRef, useState } from 'react'
import { Dimensions } from 'react-native'
import { ActivityIndicator, Platform, StyleSheet, View } from 'react-native'
import { MentionInput } from 'react-native-controlled-mentions'
import { TouchableOpacity, FlatList } from 'react-native-gesture-handler'
import { useSafeAreaInsets } from 'react-native-safe-area-context'
import { Avatar, IconComponent, Txt } from '../../elements'
import { KeyboardSpacer } from '../../tools'
@ -62,9 +61,8 @@ export const ChatBar: FC<ChatBarProps> = props => { @@ -62,9 +61,8 @@ export const ChatBar: FC<ChatBarProps> = props => {
key={item?.id}
style={styles.item}
onPress={() => {
onSuggestionPress(item)
inputRef.current.focus()
setTimeout(() => onSuggestionPress(item), 100)
}}>
<Avatar
imageUrl={item.avatar}

Loading…
Cancel
Save