Skip to content

Commit af2b87f

Browse files
committed
fix chatbox auto scrolling
1 parent c243924 commit af2b87f

File tree

1 file changed

+10
-5
lines changed
  • Intersect.Client.Core/Interface/Game/Chat

1 file changed

+10
-5
lines changed

Intersect.Client.Core/Interface/Game/Chat/Chatbox.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -416,18 +416,23 @@ private void Update()
416416

417417
if (scrollToBottom)
418418
{
419+
mChatboxMessages.PostLayout.Enqueue(scroller => scroller.ScrollToBottom(), mChatboxMessages);
419420
mChatboxMessages.RunOnMainThread(mChatboxMessages.ScrollToBottom);
420421
}
421422
else
422423
{
423-
mChatboxMessages.RunOnMainThread(() =>
424+
mChatboxMessages.PostLayout.Enqueue(
425+
(scroller, position) =>
424426
{
425427
ApplicationContext.CurrentContext.Logger.LogTrace(
426-
"Scrolling chat to {ScrollY}",
427-
scrollPosition
428+
"Scrolling chat ({ChatNode}) to {ScrollY}",
429+
scroller.CanonicalName,
430+
position
428431
);
429-
mChatboxMessages.ScrollToY(scrollPosition);
430-
}
432+
scroller.ScrollToY(position);
433+
},
434+
mChatboxMessages,
435+
scrollPosition
431436
);
432437
}
433438

0 commit comments

Comments
 (0)