[Resolved] Button Widget not giving up focus

Hey all,

I have been using the widget.newButton for a few projects without any issues, but after upgrading to the latest version (I don’t know which version actually broke it), the buttons are not giving up focus.

Steps to reproduce

Two buttons a blank menu.
[lua]playBtn = widget.newButton{
sheet = asset_sheet,
defaultIndex=11, overIndex = 12,
labelColor = { default={ 128, 255, 96, 255 }, over={ 0 } },
width=165, height=165,
left = 292, top = 58,
onRelease = onPlayBtnRelease, – event listener function
onDrag = onPlayBtnRelease
}
storeBtn = widget.newButton{
sheet = asset_sheet,
defaultIndex=13, overIndex = 14,
labelColor = { default={ 128, 255, 96, 255 }, over={ 0 } },
width=97, height=97,
left = 2, top = 198,
onRelease = onStoreBtnRelease – event listener function
}[/lua]

For the sake of this example, lets say that both listener functions just return true.
Also, the example has same results with and without imageSheets.

So, to reproduce the issue, you simply need to initiate a touch on one button and then drag off the button before releasing. Anywhere you click from now on will continue to trigger that button’s default/over images.

I have tried changing the onRelease event to an onEvent event, and manly tried to control the focus using ‘display.getCurrentStage():setFocus( )’

Please let me know if there is anything else you want me to provide. I could whip up a sample project pretty easily, but I figured it wasn’t entirely necessary. Let me know if you want me to provide a simple example in a bug report.

Regards,
Brian Reinhart

[import]uid: 158289 topic_id: 30276 reply_id: 330276[/import]

Hey Brian - could you file a bug report, please? That would be great. I just noticed an email waiting from you as well, will read it tomorrow. (Sorry, travel messes me up a bit on mails.) [import]uid: 52491 topic_id: 30276 reply_id: 121448[/import]

Peach,

Thanks for the reply, but I actually just figured out the issue. I wasn’t able to reproduce the issue on my “demo” project I was going to submit which made me dig a bit further.

I figured out that the third party library for Corona Ultimote was causing the problem. When I comment this library out, everything works great.

I hope you had fun in your travels! You don’t have to worry about the email, the Ansca team was able to fix the bug and publish a fixed build super quick!

Regards,
Brian Reinhart [import]uid: 158289 topic_id: 30276 reply_id: 121452[/import]

Awesome to hear that Brian :slight_smile:

Thanks for posting that here, about Corona Utilimote, it’s a great tool but yeah, well worth noting that! [import]uid: 52491 topic_id: 30276 reply_id: 121574[/import]

Hey Brian - could you file a bug report, please? That would be great. I just noticed an email waiting from you as well, will read it tomorrow. (Sorry, travel messes me up a bit on mails.) [import]uid: 52491 topic_id: 30276 reply_id: 121448[/import]

Peach,

Thanks for the reply, but I actually just figured out the issue. I wasn’t able to reproduce the issue on my “demo” project I was going to submit which made me dig a bit further.

I figured out that the third party library for Corona Ultimote was causing the problem. When I comment this library out, everything works great.

I hope you had fun in your travels! You don’t have to worry about the email, the Ansca team was able to fix the bug and publish a fixed build super quick!

Regards,
Brian Reinhart [import]uid: 158289 topic_id: 30276 reply_id: 121452[/import]

Awesome to hear that Brian :slight_smile:

Thanks for posting that here, about Corona Utilimote, it’s a great tool but yeah, well worth noting that! [import]uid: 52491 topic_id: 30276 reply_id: 121574[/import]