Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions widgetLibrary/widget_button.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ local isByteColorRange = display.getDefault( "isByteColorRange" )
local function manageButtonTouch( view, event )
local phase = event.phase

-- If the button isn't active, just return
if not view._isEnabled then
-- If the button isn't active or it has somehow already been removed, just return
if not view._isEnabled or type( view.parent ) ~= "table" or view.parent.x == nil then
return
end

Expand All @@ -43,13 +43,9 @@ local function manageButtonTouch( view, event )
view._onPress( event )
end

-- If the parent group still exists
if "table" == type( view.parent ) then
-- Set focus on the button
view._isFocus = true
display.getCurrentStage():setFocus( view, event.id )

end
-- Set focus on the button
view._isFocus = true
display.getCurrentStage():setFocus( view, event.id )

elseif view._isFocus then
if "moved" == phase then
Expand Down