From ec84cbc043bebf4939c277a16b67b113552aa4dc Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 28 Oct 2020 23:06:14 +0800 Subject: [PATCH] fix choicebox --- src/ltui/choicebox.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ltui/choicebox.lua b/src/ltui/choicebox.lua index e9b0bb7..e02626b 100644 --- a/src/ltui/choicebox.lua +++ b/src/ltui/choicebox.lua @@ -99,6 +99,18 @@ end -- do select the current config function choicebox:_do_select() + -- clear selected text + for v in self:views() do + local text = v:text() + if text and text:startswith("(X) ") then + local i = v:extra("index") + if i then + local t = self._VALUES[i] + v:text_set("( ) " .. tostring(t)) + end + end + end + -- get the current item local item = self:current()