diff options
author | Claire <claire.github-309c@sitedethib.com> | 2021-03-24 10:19:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-24 10:19:07 +0100 |
commit | 034f37b85a716872f78a72048a5a225cdcaa840a (patch) | |
tree | 6177873d6abc60e7a11915f3d1b7f0ab1521f2db /app/javascript/mastodon/features/compose/components/compose_form.js | |
parent | 49814d579932496b52cd8f6a0194c21c21f83099 (diff) |
Fix compose form behavior in mobile view (#15555)
* Fix ComposeForm being mounted twice in mobile view Fixes #13094 * Fix compose form focus and pre-selection behavior in mobile view * Split _updateFocusAndSelection out of componentDidUpdate
Diffstat (limited to 'app/javascript/mastodon/features/compose/components/compose_form.js')
-rw-r--r-- | app/javascript/mastodon/features/compose/components/compose_form.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/javascript/mastodon/features/compose/components/compose_form.js b/app/javascript/mastodon/features/compose/components/compose_form.js index 8af806ec4..ba2d20cc7 100644 --- a/app/javascript/mastodon/features/compose/components/compose_form.js +++ b/app/javascript/mastodon/features/compose/components/compose_form.js @@ -132,7 +132,15 @@ class ComposeForm extends ImmutablePureComponent { } } + componentDidMount () { + this._updateFocusAndSelection({ }); + } + componentDidUpdate (prevProps) { + this._updateFocusAndSelection(prevProps); + } + + _updateFocusAndSelection = (prevProps) => { // This statement does several things: // - If we're beginning a reply, and, // - Replying to zero or one users, places the cursor at the end of the textbox. |