Frank icon indicating copy to clipboard operation
Frank copied to clipboard

Drag/Swipe over a scroll view - the scroll view ends in invalid state

Open ondrejhanslik opened this issue 12 years ago • 5 comments

Very weird issue happening (iOS 6.1 Simulator). When I drag or swipe using the methods in UIView+PublicAutomation over a scroll view (or table view or web view), the scroll view correctly scrolls but never stops scrolling (scroll indicator stays visible and the view won't accept any taps).

I have experimented with the code inside UIAutomationBridge (number of points, gesture duration) and logged the UIEvent objects delivered to the app and everything seems to be fine with one exception - the latest events from the drag/swipe have view set to nil.

Maybe the problem is inside UI Automation framework.

ondrejhanslik avatar Apr 25 '13 21:04 ondrejhanslik

Is this just in the 6.1 simulator, or in 6.0 too?

Cheers,

Pete

Typed on a little bitty keyboard

On Apr 25, 2013, at 2:53 PM, ondrejhanslik [email protected] wrote:

Very weird issue happening (iOS 6.1 Simulator). When I drag or swipe using the methods in UIView+PublicAutomation over a scroll view (or table view or web view), the scroll view correctly scrolls but never stops scrolling (scroll indicator stays visible and the view won't accept any taps).

I have experimented with the code inside UIAutomationBridge (number of points, gesture duration) and logged the UIEvent objects delivered to the app and everything seems to be fine with one exception - the latest events from the drag/swipe have view set to nil.

Maybe the problem is inside UI Automation framework.

— Reply to this email directly or view it on GitHub.

moredip avatar Apr 26 '13 00:04 moredip

Reproduced on 6.1, 6.0, 5.1 ipad simulators. Doesn't happen everytime but happens almost everytime.

Currently I am using the scroll helper as a workaround but I don't like tampering with the content offset directly because I depend on the dragging delegate methods.

ondrejhanslik avatar Apr 26 '13 09:04 ondrejhanslik

Would you be able to add a example failing test to the Controls app in the repo which demonstrates this issue so I can reproduce locally and look into a fix?

Cheers,

Pete

Typed on a little bitty keyboard

On Apr 26, 2013, at 2:44 AM, ondrejhanslik [email protected] wrote:

Reproduced on 6.1, 6.0, 5.1 ipad simulators. Doesn't happen everytime but happens almost everytime.

Currently I am using the scroll helper as a workaround but I don't like tampering with the content offset directly because I depend on the dragging delegate methods.

— Reply to this email directly or view it on GitHub.

moredip avatar Apr 26 '13 15:04 moredip

Just tested.

  1. frank update
  2. frank launch
  3. frank console
  4. frankly_map("view:'UIScrollView' first", "swipeInDirection:", "up") or frankly_map("view:'UIScrollView' first", "swipeInDirection:", "down")
  5. It's easily seen because the scroll indicator doesn't hide but you can check by frankly_map("view:'UIScrollView' first", "isDragging")

(it's possible you will have to repeat 4. several times)

ondrejhanslik avatar Apr 26 '13 16:04 ondrejhanslik

I spent the last couple of days trying to understand this issue and I am sure that:

  1. All the events are correctly delivered
  2. The pan recognizer in the scroll view/table view correctly gets the touch up event and ends the gesture

I was able to reproduce the same error using UI Automation: tableView.dragInsideWithOptions({startOffset:{x:0.5, y:0.5}, endOffset:{x:0.55, y:0.8}, duration:0.1}); However, with UI Automation the error appears with much lower probability (only once after many tests).

One interesting fact is that the events generated by dragInsideWithOptions are different from the events generated by UIAutomationBridge.

When UIAutomation gesture duration is set to 0.1, the interval between touch down and touch up events is actually 0.2 seconds.

When I tried to change SWIPE_DURATION in UIAutomationBridge to some bigger value, nothing happened. It's strange, but the gesture is always only 0.1 seconds long, and generates only 3 events.

ondrejhanslik avatar May 13 '13 14:05 ondrejhanslik