Skip to content

Commit

Permalink
Handle suggestions only on selection change
Browse files Browse the repository at this point in the history
  • Loading branch information
paultsimura committed Sep 29, 2023
1 parent dfb3f9b commit a4f4a77
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit a4f4a77

Please sign in to comment.