From a4f4a7708ba9c2ca7f2d03604c7962c4f3e69def Mon Sep 17 00:00:00 2001 From: Pavlo Tsimura Date: Fri, 29 Sep 2023 12:26:28 +0200 Subject: [PATCH] Handle suggestions only on selection change --- .../home/report/ReportActionCompose/SuggestionMention.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionCompose/SuggestionMention.js b/src/pages/home/report/ReportActionCompose/SuggestionMention.js index 6c08b68cdc78..fea1f2e845a5 100644 --- a/src/pages/home/report/ReportActionCompose/SuggestionMention.js +++ b/src/pages/home/report/ReportActionCompose/SuggestionMention.js @@ -234,7 +234,10 @@ function SuggestionMention({ useEffect(() => { calculateMentionSuggestion(selection.end); - }, [selection, calculateMentionSuggestion]); + + // We want this hook to run only on selection change. + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [selection]); const updateShouldShowSuggestionMenuToFalse = useCallback(() => { setSuggestionValues((prevState) => {