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.
This commit is contained in:
Brues
2026-11-01 17:22:06 -06:00
parent 77be27094a
commit 3651341697
+8 -2
View File
@@ -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