button:setEnabled( false ) not working in all cases?

I have a button that I disable immediately in the ‘if event.phase == “ended” then’ portion of the even handler.

However, it (at least it appears to be ) letting me “double tap” it if I very quickly tap the button repeatedly.

It only happens on occasion though (10%~) , not every time . Is this a know issue? Am I tapping it twice in the same frame or something? 

FYI, lots of other stuff is happening in the frame…

Thanks for the help!

Hi @gullie667,

Did you increase the system’s “tap delay” to more than normal? I suppose it’s possible that you can tap it twice, and if there’s a lot happening in the same timestep as where the button is disabled, the chances may increase that two taps can sneak in. Can you refactor your code slightly, so that the disabling occurs, then you do the other tasks after a 10 ms timer or something?

Best regards,

Brent

I think I might just leave it… if you are opening the menu like that you are obviously checking to see if you can break it… And it is recoverable by reentering the menu. It’d be a huge pain to refactor for the one guy looking for a bug and Ta’Da, finding one. Unless Apple will bounce apps for things like this… Hopefully they don’t.

Thanks,

Gullie

Hi @gullie667,

Did you increase the system’s “tap delay” to more than normal? I suppose it’s possible that you can tap it twice, and if there’s a lot happening in the same timestep as where the button is disabled, the chances may increase that two taps can sneak in. Can you refactor your code slightly, so that the disabling occurs, then you do the other tasks after a 10 ms timer or something?

Best regards,

Brent

I think I might just leave it… if you are opening the menu like that you are obviously checking to see if you can break it… And it is recoverable by reentering the menu. It’d be a huge pain to refactor for the one guy looking for a bug and Ta’Da, finding one. Unless Apple will bounce apps for things like this… Hopefully they don’t.

Thanks,

Gullie