mirror of
https://github.com/brues-code/pfUI.git
synced 2026-11-02 08:56:57 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user