Skip to content

Conversation

@mori-atsushi
Copy link
Collaborator

close #276

viewからviewModelに持ってきた。
若干まだ汚い。

}
.subscribe {
val isScrolledToEnd = scrolledToEnd.get()
scrolledToEnd.set(false)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ホントはこの意味不明なこの文を書きたくない。

スクロールされたタイミングで scrolledToEnd を更新してるんだけど、データを追加した時にスクロールはされないので、実際の状態と保持している状態が食い違ってしまう。
そして、 false から true になる時のみメソッドが呼ばれるので、明示的に false にしてあげないとスクロールされないことになる。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

自動でこれなってほしいのは分からなくも無いんだけど,まあしょうがないし違和感の原因はsubscribeのなかでごちゃごちゃ書いていることなのでこの一連の処理をメソッドで切り出せばいいのかなぁとは思う.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

しょうがないのかなぁ…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

チャットのスクロール制御

3 participants