AutosuggestPlugin: clear suggestions after selecting a suggestion

This commit is contained in:
Alex Gleason 2023-09-23 14:26:43 -05:00
parent aa4992e716
commit 206927fd4b
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -30,7 +30,7 @@ import React, {
} from 'react'; } from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import { fetchComposeSuggestions } from 'soapbox/actions/compose'; import { clearComposeSuggestions, fetchComposeSuggestions } from 'soapbox/actions/compose';
import { useEmoji } from 'soapbox/actions/emojis'; import { useEmoji } from 'soapbox/actions/emojis';
import AutosuggestEmoji from 'soapbox/components/autosuggest-emoji'; import AutosuggestEmoji from 'soapbox/components/autosuggest-emoji';
import { isNativeEmoji } from 'soapbox/features/emoji'; import { isNativeEmoji } from 'soapbox/features/emoji';
@ -335,6 +335,8 @@ const AutosuggestPlugin = ({
node.setTextContent(`@${content} `); node.setTextContent(`@${content} `);
node.select(); node.select();
} }
dispatch(clearComposeSuggestions(composeId));
}); });
}); });
}; };