about summary refs log tree commit diff
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-10-30 18:21:38 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-10-30 18:21:38 +0100
commit7e356503984e724d713e07191886a7ddc212a63a (patch)
treeeba95a7e3cd82d4f35b0dd6846ec4b3dffd677a7 /app/assets/javascripts
parentc49f6290eb9c93720bd5407f4320bb0fd6c96ed9 (diff)
Actually complete the autosuggestion feature
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/components/actions/compose.jsx2
-rw-r--r--app/assets/javascripts/components/features/ui/components/compose_form.jsx4
2 files changed, 3 insertions, 3 deletions
diff --git a/app/assets/javascripts/components/actions/compose.jsx b/app/assets/javascripts/components/actions/compose.jsx
index e27b606ee..b576c7444 100644
--- a/app/assets/javascripts/components/actions/compose.jsx
+++ b/app/assets/javascripts/components/actions/compose.jsx
@@ -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));
diff --git a/app/assets/javascripts/components/features/ui/components/compose_form.jsx b/app/assets/javascripts/components/features/ui/components/compose_form.jsx
index 464423cf8..0655a7c79 100644
--- a/app/assets/javascripts/components/features/ui/components/compose_form.jsx
+++ b/app/assets/javascripts/components/features/ui/components/compose_form.jsx
@@ -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 = {