I am having a similar problem when using the tableView widget. However, there seems to be no takeFocus() for tableView. How might I prevent touch events from being recognized by my buttons in the tableView while I am trying instead to scroll?
Re-opening this topic because this appears to be happening for me again.
I implemented the “dispatchEvent” method and had this working in my code. However, it is now not working and I have not changed my code.
Did something get changed on the Corona side? Is there a new/better way to deal with it?
To clarify what I am doing is the following:
- I create a scrollView
- I add some buttons inside the scrollView
- If I tap on top of one of the buttons and then move significantly:
- I pass the focus down to the scrollview using myScrollView:takeFocus( event )
- Then I dispatch an event to my button: myBtn:dispatchEvent( {name = “touch”, target = myBtn, phase = “ended”} )
- The scrollView correctly deals with that tap and doesn’t respond to the button at that time.
- However, if I then scroll back to that button and attempt to tap that particular button, it doesn’t respond to the taps. That is, the began phase is never called. The tap/touch event goes straight through to the scrollView.
- Within the scrollview I have attempted to reset the focus using display.getCurrentStage():setFocus(nil). However this doesn’t seem to change the behaviour at all.
Is this happening to anyone else who previously used the dispatchEvent solution?
Would like to find a solution quickly.
Thanks!
Re-opening this topic because this appears to be happening for me again.
I implemented the “dispatchEvent” method and had this working in my code. However, it is now not working and I have not changed my code.
Did something get changed on the Corona side? Is there a new/better way to deal with it?
To clarify what I am doing is the following:
- I create a scrollView
- I add some buttons inside the scrollView
- If I tap on top of one of the buttons and then move significantly:
- I pass the focus down to the scrollview using myScrollView:takeFocus( event )
- Then I dispatch an event to my button: myBtn:dispatchEvent( {name = “touch”, target = myBtn, phase = “ended”} )
- The scrollView correctly deals with that tap and doesn’t respond to the button at that time.
- However, if I then scroll back to that button and attempt to tap that particular button, it doesn’t respond to the taps. That is, the began phase is never called. The tap/touch event goes straight through to the scrollView.
- Within the scrollview I have attempted to reset the focus using display.getCurrentStage():setFocus(nil). However this doesn’t seem to change the behaviour at all.
Is this happening to anyone else who previously used the dispatchEvent solution?
Would like to find a solution quickly.
Thanks!