about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-12-14 18:38:28 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-12-14 18:38:28 +0100
commit4df38516e67c9739f457c452259210dc973519a3 (patch)
treec9d5f29e56717cc8540f3a0604adb8b5ed4529e5
parentb27066e154c8c2da57f23bf659907bacd37ce4da (diff)
Fix key up listener on compose form
-rw-r--r--app/assets/javascripts/components/components/autosuggest_textarea.jsx6
-rw-r--r--app/assets/javascripts/components/features/compose/components/compose_form.jsx1
2 files changed, 5 insertions, 2 deletions
diff --git a/app/assets/javascripts/components/components/autosuggest_textarea.jsx b/app/assets/javascripts/components/components/autosuggest_textarea.jsx
index 378b0cda4..95ca5f2f6 100644
--- a/app/assets/javascripts/components/components/autosuggest_textarea.jsx
+++ b/app/assets/javascripts/components/components/autosuggest_textarea.jsx
@@ -36,7 +36,8 @@ const AutosuggestTextarea = React.createClass({
     onSuggestionSelected: React.PropTypes.func.isRequired,
     onSuggestionsClearRequested: React.PropTypes.func.isRequired,
     onSuggestionsFetchRequested: React.PropTypes.func.isRequired,
-    onChange: React.PropTypes.func.isRequired
+    onChange: React.PropTypes.func.isRequired,
+    onKeyUp: React.PropTypes.func
   },
 
   getInitialState () {
@@ -122,7 +123,7 @@ const AutosuggestTextarea = React.createClass({
   },
 
   render () {
-    const { value, suggestions, disabled, placeholder } = this.props;
+    const { value, suggestions, disabled, placeholder, onKeyUp } = this.props;
     const { suggestionsHidden, selectedSuggestion } = this.state;
 
     return (
@@ -135,6 +136,7 @@ const AutosuggestTextarea = React.createClass({
           value={value}
           onChange={this.onChange}
           onKeyDown={this.onKeyDown}
+          onKeyUp={onKeyUp}
         />
 
         <div style={{ display: (suggestions.size > 0 && !suggestionsHidden) ? 'block' : 'none' }} className='autosuggest-textarea__suggestions'>
diff --git a/app/assets/javascripts/components/features/compose/components/compose_form.jsx b/app/assets/javascripts/components/features/compose/components/compose_form.jsx
index 02f394993..200502dad 100644
--- a/app/assets/javascripts/components/features/compose/components/compose_form.jsx
+++ b/app/assets/javascripts/components/features/compose/components/compose_form.jsx
@@ -104,6 +104,7 @@ const ComposeForm = React.createClass({
           value={this.props.text}
           onChange={this.handleChange}
           suggestions={this.props.suggestions}
+          onKeyUp={this.handleKeyUp}
           onSuggestionsFetchRequested={this.onSuggestionsFetchRequested}
           onSuggestionsClearRequested={this.onSuggestionsClearRequested}
           onSuggestionSelected={this.onSuggestionSelected}