Skip to content

Commit

Permalink
Merge pull request Expensify#24512 from WikusKriek/24265-Suggestion-l…
Browse files Browse the repository at this point in the history
…ist-not-display-when-open-group-chat

24265 suggestion list not display when open group chat
  • Loading branch information
Beamanator authored Aug 18, 2023
2 parents c435734 + 3c9ac62 commit 6319e59
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/pages/home/report/ReportActionCompose.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,6 @@ class ReportActionCompose extends React.Component {
onSelectionChange(e) {
LayoutAnimation.configureNext(LayoutAnimation.create(50, LayoutAnimation.Types.easeInEaseOut, LayoutAnimation.Properties.opacity));
this.setState({selection: e.nativeEvent.selection});
if (!this.state.value || e.nativeEvent.selection.end < 1) {
this.resetSuggestions();
this.shouldBlockEmojiCalc = false;
this.shouldBlockMentionCalc = false;
return;
}
this.calculateEmojiSuggestion();
this.calculateMentionSuggestion();
}
Expand Down Expand Up @@ -533,8 +527,9 @@ class ReportActionCompose extends React.Component {
* Calculates and cares about the content of an Emoji Suggester
*/
calculateEmojiSuggestion() {
if (this.shouldBlockEmojiCalc) {
if (this.shouldBlockEmojiCalc || !this.state.value) {
this.shouldBlockEmojiCalc = false;
this.resetSuggestions();
return;
}

Expand Down Expand Up @@ -564,8 +559,9 @@ class ReportActionCompose extends React.Component {
}

calculateMentionSuggestion() {
if (this.shouldBlockMentionCalc) {
if (this.shouldBlockMentionCalc || this.state.selection.end < 1) {
this.shouldBlockMentionCalc = false;
this.resetSuggestions();
return;
}

Expand Down

0 comments on commit 6319e59

Please sign in to comment.