feat: scroll to new position after moving item in menu (#552)

This commit is contained in:
christoph-heinrich
2023-05-05 08:50:17 +02:00
committed by GitHub
parent 3369454a68
commit 5e2c930551

View File

@@ -506,7 +506,7 @@ function Menu:move_selected_item_to(index)
if callback and from and from ~= index and index >= 1 and index <= #self.current.items then
callback(from, index, self.current.submenu_path)
self.current.selected_index = index
request_render()
self:set_scroll_by((index - from) * self.scroll_step)
end
end