about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOndřej Hruška <ondra@ondrovo.com>2017-07-22 21:48:56 +0200
committerOndřej Hruška <ondra@ondrovo.com>2017-07-22 21:48:56 +0200
commit3ba7c1e725417dded555d6a5b9a3911c39e355bf (patch)
treeb274956a7813e812230c9a402785c49954b45ce9
parent9b74a120450ba4e27960c36753bec6217c07065b (diff)
Textarea does not auto-expand on mobile anymore (autofocus only on desktop)
-rw-r--r--app/javascript/mastodon/features/compose/components/compose_form.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/javascript/mastodon/features/compose/components/compose_form.js b/app/javascript/mastodon/features/compose/components/compose_form.js
index 58064fac2..9137493e7 100644
--- a/app/javascript/mastodon/features/compose/components/compose_form.js
+++ b/app/javascript/mastodon/features/compose/components/compose_form.js
@@ -18,6 +18,7 @@ import UploadFormContainer from '../containers/upload_form_container';
 import WarningContainer from '../containers/warning_container';
 import ImmutablePureComponent from 'react-immutable-pure-component';
 import { length } from 'stringz';
+import { isMobile } from '../../../is_mobile';
 
 const messages = defineMessages({
   placeholder: { id: 'compose_form.placeholder', defaultMessage: 'What is on your mind?' },
@@ -184,7 +185,7 @@ export default class ComposeForm extends ImmutablePureComponent {
             onSuggestionsClearRequested={this.onSuggestionsClearRequested}
             onSuggestionSelected={this.onSuggestionSelected}
             onPaste={onPaste}
-            autoFocus={!showSearch}
+            autoFocus={!showSearch && isMobile(window.innerWidth)}
           />
 
           <EmojiPickerDropdown onPickEmoji={this.handleEmojiPick} />