Enable / Disable touch input on Picker Wheel

Is it possible to “disable” the picker wheel so that it can ignore touch input?

The problem I have is that in my app I have my picker wheel slide up behind a footer (the show / hide button for the picker wheel is on the footer in the bottom right hand corner), sometimes I’ve found that pressing the button can cause the picker wheel to interpret rogue touch events on the right hand side as it slides in which causes the right hand column to get dragged out of position.

What I want to do is disable touch input on the picker wheel whilst it’s sliding in, re-enable it as soon as the transition is finished and then disable it again when it starts to slide out.

Is this possible,  I’ve looked through the widget code on github and couldn’t find it.

I’ve considered putting a rect over the area to catch events but if you set the alpha value to be 0 (to make this rect invisible) then it doesn’t appear to receive any events.

Is there something I can do with setFocus() that might work?

Hi @techdojo,

There’s not a built-in way to disable the picker wheel. Your idea of putting a “blocking rectangle” over the region is the best approach, and it will work at “.alpha=0” or “.isVisible=false” as long as you set the “.isHitTestable” property to true:

https://docs.coronalabs.com/daily/api/type/DisplayObject/isHitTestable.html

Best regards,

Brent

Thanks Brent that’s good to know - I’ll try that approach and see if it makes a difference :slight_smile:

Hi @techdojo,

There’s not a built-in way to disable the picker wheel. Your idea of putting a “blocking rectangle” over the region is the best approach, and it will work at “.alpha=0” or “.isVisible=false” as long as you set the “.isHitTestable” property to true:

https://docs.coronalabs.com/daily/api/type/DisplayObject/isHitTestable.html

Best regards,

Brent

Thanks Brent that’s good to know - I’ll try that approach and see if it makes a difference :slight_smile: