Chat: sending a message always scrolls to the bottom
After a send the view jumps to the end of the conversation and resumes following, even when the operator had scrolled up or the message is taller than the screen, so the message's end and the reply stay in view.
This commit is contained in:
@@ -318,6 +318,18 @@ class _ChatThreadViewState extends State<ChatThreadView> {
|
||||
if (!mounted) return;
|
||||
_controller.removeLocal(send.operationId);
|
||||
_controller.insertLocal(send.toMessage());
|
||||
// Sending always shows the end of the conversation, even when the
|
||||
// operator had scrolled up or the message is taller than the screen;
|
||||
// following resumes so the reply stays in view too.
|
||||
setState(() {
|
||||
_following = true;
|
||||
_newestAtRelease = null;
|
||||
_distanceFromBottom = 0;
|
||||
});
|
||||
_abandonRestore();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (mounted && !_userScrolling) _jumpToBottom();
|
||||
});
|
||||
}
|
||||
|
||||
/// A refused message leaves the transcript; it is drawn after it as "Not
|
||||
|
||||
Reference in New Issue
Block a user