BUG: Switch widget style="onOff" onRelease and onEvent events never fire

Hi all,

I can’t seem to get the switch widget to fire the onRelease or onEvent events. The only event that actually works on it is the onPress event.

Just thought I would give everyone a heads up so as to reduce frustration!  :slight_smile:

FYI: the doc says it does support these events: http://docs.coronalabs.com/api/library/widget/newSwitch.html

Corona Build 2014.2189

Hi @spacewolf,

We’re aware of this bug and it’ll be fixed in an upcoming daily build.

Thanks,

Brent

Brent: any idea if the upcoming fix will re-enable dragging on iOS7 style switches? At the moment, they only seem to support tapping, which breaks the illusion that they are native. Thanks!

Hi @schroederapps,

Truthfully, this probably won’t happen from our end. Making the iOS7 switches “slide” would require some intense coding, since the handle part visually “stretches”, along with the green background fading in and out, and all of that would need to handled in a Runtime listener (not a transition) or some kind of progressive forward-backward sprite animation. Also, the fact that the iOS7 switches are so small makes this a low priority… I actually had to peek “below my touch” on my phone to even see exactly how the handle stretches and flexes as I slide it back and forth. :slight_smile:

Anyway, I know this isn’t what you wanted to hear, and I understand the widget switch doesn’t behave “100% native” in this regard, but I want to be honest about where we stand on this.

Take care,

Brent

Hi Brent,

No worries, but thanks for the quick and honest response. I get it, you guys have bigger fish to fry. I just wanted to make sure a change wasn’t coming soon before I rolled my own solution. :slight_smile:

Have a good holiday weekend!

Hi @spacewolf,

We’re aware of this bug and it’ll be fixed in an upcoming daily build.

Thanks,

Brent

Brent: any idea if the upcoming fix will re-enable dragging on iOS7 style switches? At the moment, they only seem to support tapping, which breaks the illusion that they are native. Thanks!

Hi @schroederapps,

Truthfully, this probably won’t happen from our end. Making the iOS7 switches “slide” would require some intense coding, since the handle part visually “stretches”, along with the green background fading in and out, and all of that would need to handled in a Runtime listener (not a transition) or some kind of progressive forward-backward sprite animation. Also, the fact that the iOS7 switches are so small makes this a low priority… I actually had to peek “below my touch” on my phone to even see exactly how the handle stretches and flexes as I slide it back and forth. :slight_smile:

Anyway, I know this isn’t what you wanted to hear, and I understand the widget switch doesn’t behave “100% native” in this regard, but I want to be honest about where we stand on this.

Take care,

Brent

Hi Brent,

No worries, but thanks for the quick and honest response. I get it, you guys have bigger fish to fry. I just wanted to make sure a change wasn’t coming soon before I rolled my own solution. :slight_smile:

Have a good holiday weekend!