diff options
author | fusshi- <dikky1218@users.noreply.github.com> | 2017-05-10 09:51:43 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-05-10 02:51:43 +0200 |
commit | 29d8313b28ee5a0f6e18141028185e757035b547 (patch) | |
tree | b13409f0de74baeb09fbacd0c6043e5521d737b5 /app/javascript/mastodon/components/autosuggest_textarea.js | |
parent | 682507bc3c954239c11934faddcd3ba2934a4d4d (diff) |
Disabled auto focus on toot form when search results are shown. (#2942)
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; |