don't lose List scroll position when dragging

develop
Myk Taylor 2023-02-02 19:42:41 -08:00
parent aa2339d2aa
commit 2cf985be73
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
1 changed files with 5 additions and 5 deletions

@ -1609,15 +1609,15 @@ function List:getContentHeight()
return #self.choices * self.row_height
end
function List:postComputeFrame(body)
self.page_size = math.max(1, math.floor(body.height / self.row_height))
self:moveCursor(0)
end
local function update_list_scrollbar(list)
list.scrollbar:update(list.page_top, list.page_size, #list.choices)
end
function List:postComputeFrame(body)
self.page_size = math.max(1, math.floor(body.height / self.row_height))
update_list_scrollbar(self)
end
function List:postUpdateLayout()
update_list_scrollbar(self)
end