diff options
| author | ruki <[email protected]> | 2018-01-16 00:26:07 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-01-15 20:36:45 +0800 |
| commit | f0cd6845f16de9b6b55925b31e68114c01be2b18 (patch) | |
| tree | 128acd381836305d0c99bf5cccd9de1c3fc2976b | |
| parent | a36785d37fa91a238a3c5358f0dadb2f8de473d3 (diff) | |
improve select next and prev
| -rw-r--r-- | xmake/core/ui/panel.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xmake/core/ui/panel.lua b/xmake/core/ui/panel.lua index 17a35531e..5057fe2bc 100644 --- a/xmake/core/ui/panel.lua +++ b/xmake/core/ui/panel.lua @@ -201,8 +201,8 @@ function panel:select_next(start) -- select the next view local next = self:next(current) - while next and next ~= current do - if next:option("selectable") and next:state("visible") then + while next ~= current do + if next and next:option("selectable") and next:state("visible") then return self:select(next) end next = self:next(next) @@ -222,8 +222,8 @@ function panel:select_prev(start) -- select the previous view local prev = self:prev(current) - while prev and prev ~= current do - if prev:option("selectable") and prev:state("visible") then + while prev ~= current do + if prev and prev:option("selectable") and prev:state("visible") then return self:select(prev) end prev = self:prev(prev) |
