From 6d9cbb6b2ece2ae31ab35978d6158ee9b251088b Mon Sep 17 00:00:00 2001 From: wikuskriek Date: Thu, 10 Aug 2023 14:26:38 +0200 Subject: [PATCH 1/2] fix: suggestions not showing --- src/pages/home/report/ReportActionCompose.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index 123d804409a4..0beb937c2b77 100644 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -301,12 +301,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(); } @@ -531,7 +525,7 @@ 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; return; } @@ -562,8 +556,9 @@ class ReportActionCompose extends React.Component { } calculateMentionSuggestion() { - if (this.shouldBlockMentionCalc) { + if (this.shouldBlockMentionCalc || this.state.selection.end < 1) { this.shouldBlockMentionCalc = false; + this.resetSuggestions(); return; } From c7cd29ecad1285d8d9d6067062e994fcc284c06c Mon Sep 17 00:00:00 2001 From: wikuskriek Date: Sun, 13 Aug 2023 16:40:36 +0200 Subject: [PATCH 2/2] fix: add reset suggestions --- src/pages/home/report/ReportActionCompose.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index 0beb937c2b77..d73311aed876 100644 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -527,6 +527,7 @@ class ReportActionCompose extends React.Component { calculateEmojiSuggestion() { if (this.shouldBlockEmojiCalc || !this.state.value) { this.shouldBlockEmojiCalc = false; + this.resetSuggestions(); return; }