From 1817f0de4ed1df310b649c8544851d79cc8e4101 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 1 Dec 2020 00:30:38 +0800 Subject: fix back after scrolling --- xmake/core/ui/choicebox.lua | 3 +++ xmake/core/ui/menuconf.lua | 3 +++ 2 files changed, 6 insertions(+) diff --git a/xmake/core/ui/choicebox.lua b/xmake/core/ui/choicebox.lua index da39dc00c..72964e4d0 100644 --- a/xmake/core/ui/choicebox.lua +++ b/xmake/core/ui/choicebox.lua @@ -51,6 +51,9 @@ function choicebox:load(values, selected) -- clear the views first self:clear() + -- reset start index + self._STARTINDEX = 1 + -- load items local items = {} for idx, value in ipairs(values) do diff --git a/xmake/core/ui/menuconf.lua b/xmake/core/ui/menuconf.lua index a2fe86d25..05e7a65f0 100644 --- a/xmake/core/ui/menuconf.lua +++ b/xmake/core/ui/menuconf.lua @@ -54,6 +54,9 @@ function menuconf:load(configs) -- clear the views first self:clear() + -- reset start index + self._STARTINDEX = 1 + -- detach the previous config and view local configs_prev = self._CONFIGS._PREV if configs_prev then -- cgit v1.3.1