Skip to content

Commit

Permalink
Changed how radio buttons are deselected
Browse files Browse the repository at this point in the history
  • Loading branch information
britzl committed Jun 13, 2018
1 parent 1acfe01 commit 507cc10
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion gooey/internal/radio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function M.button(node_id, group_id, action_id, action, fn, refresh_fn)
radio.refresh_fn = refresh_fn

core.clickable(radio, action_id, action)
radio.deselected_now = false
radio.selected_now = radio.clicked and not radio.selected or false
if radio.clicked then
radio.selected = true
Expand Down Expand Up @@ -64,7 +65,6 @@ function M.group(group_id, action_id, action, fn)
for _,radio in pairs(radiobuttons) do
radio = radio.data
if radio.group == group_key then
radio.deselected_now = false
if radio.selected_now then
selected_radio = radio
end
Expand Down
5 changes: 0 additions & 5 deletions test/test_radio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ return function()
local refresh1 = callback_listener()
local refresh2 = callback_listener()
local refresh3 = callback_listener()

local actionssss = {
actions.pressed(10, 60), actions.released(10, 60), -- select second radio button
actions.pressed(10, 10), actions.released(10, 10), -- select first radio button
}
local group1 = "group1"


Expand Down

0 comments on commit 507cc10

Please sign in to comment.