Actually complete the autosuggestion feature

th-downstream
Eugen Rochko 8 years ago
parent b91faaebbb
commit 6448169447

@ -143,7 +143,7 @@ export function fetchComposeSuggestions(token) {
return (dispatch, getState) => {
const loadedCandidates = getState().get('accounts').filter(item => item.get('acct').toLowerCase().slice(0, token.length) === token).map(item => ({
label: item.get('acct'),
completion: item.get('acct').slice(0, token.length)
completion: item.get('acct').slice(token.length)
})).toList().toJS();
dispatch(readyComposeSuggestions(loadedCandidates));

@ -31,10 +31,10 @@ const getTokenForSuggestions = (str, caretPosition) => {
}
};
const getSuggestionValue = suggestion => suggestion;
const getSuggestionValue = suggestion => suggestion.completion;
const renderSuggestion = suggestion => (
<span>{suggestion}</span>
<span>{suggestion.label}</span>
);
const textareaStyle = {

Loading…
Cancel
Save