From 36513416976c0a952f61364c54a03dc3416155cb Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Sun, 1 Nov 2026 17:22:06 -0600 Subject: [PATCH] Scroll every chat copy box to the newest line when it opens The caret at the end scrolled only the box with the focus, and each visible chat frame's box takes the focus as it opens, so only the last one shown reached the bottom. Even that one stopped short: 1.12's OnCursorChanged has no input context, so ScrollCursorIntoView lets the last line clip. Each box now measures its scroll box and scrolls it to the end on the next frame, after the edit box has laid the new text out. --- modules/chatcopy.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/chatcopy.lua b/modules/chatcopy.lua index 13de51f6..3acd8458 100644 --- a/modules/chatcopy.lua +++ b/modules/chatcopy.lua @@ -85,10 +85,16 @@ pfUI:RegisterModule("chatcopy", function () scroll:SetFont(frame:GetFont()) scroll:SetText(text) - - -- the cursor at the end scrolls the box to the newest line scroll:SetFocus() scroll:SetCursorPosition(#text) + + -- the edit box lays the text out in this frame's update, so scroll to + -- the newest line after it; the caret only scrolls the focused box + RunNextFrame(function() + local scrollBox = scroll:GetScrollBox() + scrollBox:FullUpdate(ScrollBoxConstants.UpdateImmediately) + scrollBox:ScrollToEnd(ScrollBoxConstants.NoScrollInterpolation) + end) end) frame.scroll = scroll