summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-12-01 00:30:38 +0800
committerruki <[email protected]>2020-12-01 00:30:38 +0800
commit1817f0de4ed1df310b649c8544851d79cc8e4101 (patch)
treec594424b411f716c70a6457e6b88095da74293ac
parent8e77f2f4a8a411b695eba93fb297a24635531c65 (diff)
fix back after scrolling
-rw-r--r--xmake/core/ui/choicebox.lua3
-rw-r--r--xmake/core/ui/menuconf.lua3
2 files changed, 6 insertions, 0 deletions
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