This is something I spent way too much time on debugging, so I decided to share with y’all.
Using timer.cancelAll()
can break your scrollView
scrolling - the user won’t be able to scroll all its content.
I suppose this happens because the timer created by this call https://github.com/coronalabs/corona/blob/3b798eae8a8f45ccb2876b1580aede7a9ae02197/platform/resources/widget.lua#L2662
will get cancelled.
below is somewhat minimal example:
_G.widget = require("widget")
local scrollView = widget.newScrollView {
x = display.contentCenterX,
y = display.contentCenterY,
width = 100,
height = 200
}
for i = 1,40 do
local rect = display.newRect(50, i * 15, 80, 10)
rect:setFillColor((math.pi * i) % 1, (math.pi * i * i) % 1, (math.pi * i * i * i) % 1)
scrollView:insert(rect)
end
--uncommenting this line breaks the scrollView widget
--timer.cancelAll()