BUG in button widget: disabling a button during an input event on it will render all buttons disabled

Hi,

I think I have discovered a bug in the button widget:

Consider the scenario

  1. Create 3 buttons, all with their own onRelease handlers

  2. Create a timer.performWithDelay function at a delay of 5 seconds that will setEnable(false) the first button

  3. Run your app

  4. Press and hold the first button before 5 seconds and continue holding it after 5 seconds until the timer function has executed

  5. Notice that the first button remains in a “pressed” state and that all buttons are now disabled.

Please fix!

Can you build a sample app that does this, make sure to include a config.lua and build.settings and use the File a bug report link at the top of the page?

Thanks

Rob

Okay I will submit this to your bug reporting system.

Thanks

Can you build a sample app that does this, make sure to include a config.lua and build.settings and use the File a bug report link at the top of the page?

Thanks

Rob

Okay I will submit this to your bug reporting system.

Thanks

What’s the status on this bug? It appears that I encountered the same bug in my app too. Thanks.

In my case, I have 7 buttons, all are associated with one same handler for the onPress event, and when I try to disable one of the buttons in the event callback,  all buttons appear to be disabled with the button I pressed remains in the pressed state. And I can’t even quit the overlay scene I was in.

Is there a bug report number?

I suspected the bug related to the specific button state it is in, when I switched to use the onEvent event callback, and specifically check if the phase is already in “ended” phase before I disable the button, then it appears to work, so this is at least a workaround to the issue.

Sure enough, if I set the button to disable while in the began phase of the onEvent callback, the bug occurred again, so it has to be related to the button state.

Can you please file a bug report?  It must have the build.settings and the config.lua that you are using.  After you file it, you will get an email from the bug system that has the Bug # in.  Please post it back here for a reference. 

Thanks

Rob

Rob, since I have never filed a bug report here, could you point me to a link on how to do it, including the report site URL if possible? Thanks.

It’s at the top of the page in the orange navigation bar entitled (iirc) “report a bug”

Hope this helps :slight_smile:

Yes, the “Report a Bug” link at the top of the page.  You will need to have a zip file with a sample project that has the problem.

Rob

I reported the bug on march 1, 2014.

Case 30950

What’s the status on this bug? It appears that I encountered the same bug in my app too. Thanks.

In my case, I have 7 buttons, all are associated with one same handler for the onPress event, and when I try to disable one of the buttons in the event callback,  all buttons appear to be disabled with the button I pressed remains in the pressed state. And I can’t even quit the overlay scene I was in.

Is there a bug report number?

I suspected the bug related to the specific button state it is in, when I switched to use the onEvent event callback, and specifically check if the phase is already in “ended” phase before I disable the button, then it appears to work, so this is at least a workaround to the issue.

Sure enough, if I set the button to disable while in the began phase of the onEvent callback, the bug occurred again, so it has to be related to the button state.