Fix autocomplete position in search screen (#1218)
* Fix autocomplete position in search screen * Remove autocomplete for slash commands and emojis in search
This commit is contained in:
parent
18a5535205
commit
df61ec5552
3 changed files with 12 additions and 13 deletions
|
|
@ -3,10 +3,7 @@
|
|||
|
||||
import React, {PureComponent} from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import {
|
||||
Platform,
|
||||
View
|
||||
} from 'react-native';
|
||||
import {View} from 'react-native';
|
||||
|
||||
import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme';
|
||||
|
||||
|
|
@ -123,15 +120,7 @@ const getStyleFromTheme = makeStyleSheetFromTheme((theme) => {
|
|||
elevation: 5,
|
||||
flex: 1,
|
||||
maxHeight: 250,
|
||||
zIndex: 5,
|
||||
...Platform.select({
|
||||
android: {
|
||||
top: 47
|
||||
},
|
||||
ios: {
|
||||
top: 64
|
||||
}
|
||||
})
|
||||
zIndex: 5
|
||||
}
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ export default class EmojiSuggestion extends Component {
|
|||
}).isRequired,
|
||||
cursorPosition: PropTypes.number,
|
||||
emojis: PropTypes.array.isRequired,
|
||||
isSearch: PropTypes.bool,
|
||||
theme: PropTypes.object.isRequired,
|
||||
onChangeText: PropTypes.func.isRequired,
|
||||
onResultCountChange: PropTypes.func.isRequired,
|
||||
|
|
@ -42,6 +43,10 @@ export default class EmojiSuggestion extends Component {
|
|||
};
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.isSearch) {
|
||||
return;
|
||||
}
|
||||
|
||||
const regex = EMOJI_REGEX;
|
||||
const match = nextProps.value.substring(0, nextProps.cursorPosition).match(regex);
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ export default class SlashSuggestion extends Component {
|
|||
currentTeamId: PropTypes.string.isRequired,
|
||||
commands: PropTypes.array,
|
||||
commandsRequest: PropTypes.object.isRequired,
|
||||
isSearch: PropTypes.bool,
|
||||
theme: PropTypes.object.isRequired,
|
||||
onChangeText: PropTypes.func.isRequired,
|
||||
onResultCountChange: PropTypes.func.isRequired,
|
||||
|
|
@ -43,6 +44,10 @@ export default class SlashSuggestion extends Component {
|
|||
};
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.isSearch) {
|
||||
return;
|
||||
}
|
||||
|
||||
const {currentTeamId} = this.props;
|
||||
const {
|
||||
commands: nextCommands,
|
||||
|
|
|
|||
Loading…
Reference in a new issue