From c7e84696f568cf87dd1bbde795773a1dda203183 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Wed, 9 Dec 2015 09:14:46 -0500 Subject: Removed space bar from autocompletes --- web/react/components/suggestion/command_provider.jsx | 1 - web/react/components/suggestion/suggestion_box.jsx | 2 +- web/react/stores/suggestion_store.jsx | 15 +-------------- 3 files changed, 2 insertions(+), 16 deletions(-) (limited to 'web/react') diff --git a/web/react/components/suggestion/command_provider.jsx b/web/react/components/suggestion/command_provider.jsx index a2a446de2..91d556bb9 100644 --- a/web/react/components/suggestion/command_provider.jsx +++ b/web/react/components/suggestion/command_provider.jsx @@ -39,7 +39,6 @@ export default class CommandProvider { handlePretextChanged(suggestionId, pretext) { if (pretext.startsWith('/')) { SuggestionStore.setMatchedPretext(suggestionId, pretext); - SuggestionStore.setCompleteOnSpace(suggestionId, false); AsyncClient.getSuggestedCommands(pretext, suggestionId, CommandSuggestion); } diff --git a/web/react/components/suggestion/suggestion_box.jsx b/web/react/components/suggestion/suggestion_box.jsx index ad8ad1e9e..57a33c24a 100644 --- a/web/react/components/suggestion/suggestion_box.jsx +++ b/web/react/components/suggestion/suggestion_box.jsx @@ -94,7 +94,7 @@ export default class SuggestionBox extends React.Component { } else if (e.which === KeyCodes.DOWN) { EventHelpers.emitSelectNextSuggestion(this.suggestionId); e.preventDefault(); - } else if (e.which === KeyCodes.ENTER || e.which === KeyCodes.TAB || (e.which === KeyCodes.SPACE && SuggestionStore.shouldCompleteOnSpace(this.suggestionId))) { + } else if (e.which === KeyCodes.ENTER || e.which === KeyCodes.TAB) { EventHelpers.emitCompleteWordSuggestion(this.suggestionId); e.preventDefault(); } else if (this.props.onKeyDown) { diff --git a/web/react/stores/suggestion_store.jsx b/web/react/stores/suggestion_store.jsx index 2250ec234..9cd566c22 100644 --- a/web/react/stores/suggestion_store.jsx +++ b/web/react/stores/suggestion_store.jsx @@ -38,7 +38,6 @@ class SuggestionStore extends EventEmitter { // items: a list of objects backing the terms which may be used in rendering // components: a list of react components that can be used to render their corresponding item // selection: the term currently selected by the keyboard - // completeOnSpace: whether or not space will trigger the term to be autocompleted this.suggestions = new Map(); } @@ -79,8 +78,7 @@ class SuggestionStore extends EventEmitter { terms: [], items: [], components: [], - selection: '', - completeOnSpace: true + selection: '' }); } @@ -95,7 +93,6 @@ class SuggestionStore extends EventEmitter { suggestion.terms = []; suggestion.items = []; suggestion.components = []; - suggestion.completeOnSpace = true; } clearSelection(id) { @@ -120,12 +117,6 @@ class SuggestionStore extends EventEmitter { suggestion.matchedPretext = matchedPretext; } - setCompleteOnSpace(id, completeOnSpace) { - const suggestion = this.suggestions.get(id); - - suggestion.completeOnSpace = completeOnSpace; - } - addSuggestion(id, term, item, component) { const suggestion = this.suggestions.get(id); @@ -189,10 +180,6 @@ class SuggestionStore extends EventEmitter { return this.suggestions.get(id).selection; } - shouldCompleteOnSpace(id) { - return this.suggestions.get(id).completeOnSpace; - } - selectNext(id) { this.setSelectionByDelta(id, 1); } -- cgit v1.2.3-1-g7c22