diff options
Diffstat (limited to 'app/javascript/mastodon/components/autosuggest_textarea.js')
-rw-r--r-- | app/javascript/mastodon/components/autosuggest_textarea.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/javascript/mastodon/components/autosuggest_textarea.js b/app/javascript/mastodon/components/autosuggest_textarea.js index 6d8d3b2a3..4d8f2882c 100644 --- a/app/javascript/mastodon/components/autosuggest_textarea.js +++ b/app/javascript/mastodon/components/autosuggest_textarea.js @@ -153,7 +153,7 @@ class AutosuggestTextarea extends ImmutablePureComponent { } render () { - const { value, suggestions, disabled, placeholder, onKeyUp } = this.props; + const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus } = this.props; const { suggestionsHidden, selectedSuggestion } = this.state; const style = { direction: 'ltr' }; @@ -168,7 +168,7 @@ class AutosuggestTextarea extends ImmutablePureComponent { className='autosuggest-textarea__textarea' disabled={disabled} placeholder={placeholder} - autoFocus={true} + autoFocus={autoFocus} value={value} onChange={this.onChange} onKeyDown={this.onKeyDown} @@ -208,6 +208,11 @@ AutosuggestTextarea.propTypes = { onKeyUp: PropTypes.func, onKeyDown: PropTypes.func, onPaste: PropTypes.func.isRequired, + autoFocus: PropTypes.bool +}; + +AutosuggestTextarea.defaultProps = { + autoFucus: true, }; export default AutosuggestTextarea; |