1
0
mirror of https://github.com/flarum/core.git synced 2025-10-10 22:44:25 +02:00

Improve mobile composer behaviour

- Don't scroll to the bottom of the discussion when selecting "Reply"
  from the menu if the composer is in full screen mode (ie. on mobile).
  ref #1271

- After posting a reply, scroll to the end of the discussion

- Reduce the textarea height - previously it was 100vh, but this doesn't
  account for the height of the iOS keyboard, so I've just arbitrarily
  chosen 300px instead. There may be a better solution for this.
  ref #1269
This commit is contained in:
Toby Zerner
2017-11-05 16:25:21 +10:30
parent 54597ee5eb
commit 094345de85
5 changed files with 25 additions and 12 deletions

View File

@@ -82,9 +82,10 @@ export default class ReplyComposer extends ComposerBody {
app.store.createRecord('posts').save(data).then(
post => {
// If we're currently viewing the discussion which this reply was made
// in, then we can update the post stream.
// in, then we can update the post stream and scroll to the post.
if (app.viewingDiscussion(discussion)) {
app.current.stream.update();
app.current.stream.update().then(() => app.current.stream.goToNumber(post.number()));
} else {
// Otherwise, we'll create an alert message to inform the user that
// their reply has been posted, containing a button which will