Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Highlighted
New Contributor
Posts: 7
Registered: ‎01-25-2014
My Device: z10
My Carrier: simulator
Accepted Solution

scrollTop property randomly going to 0

I'm implementing a pull down to refresh functionality for an application. I used and tested out the code from a sample app here:

https://github.com/blackberry/BB10-WebWorks-Samples/tree/master/PullDownToRefresh

 

While testing the sample application and my application on a bb10 simulator, I've noticed that the scrollTop property of the parent div tag that contains the "pull-to-refresh" div tag seems to jump to 0 at random points. This causes the arrow animation to jitter and sometimes causes the application to believe that the user is no longer pulling.

 

I think it might be because I'm using a simulator and the mouse doesn't properly simulate a touch event but I don't know for sure since I don't have a z10 device to test the application on yet. Is anyone else having this issue???

Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: scrollTop property randomly going to 0

That's the first time I've heard of this issue. However, if there is a legit defect in the sample, I'd like to know about it so we can fix it.

 

You could try connecting to remote web inspector, setting a watch on a variable representing the scroll position, and watch it in real time as you interact with the simulator.

 

 

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
New Contributor
Posts: 7
Registered: ‎01-25-2014
My Device: z10
My Carrier: simulator

Re: scrollTop property randomly going to 0

I ran the sample app on a the simulator and outputted the scrollTop property of the "scroller" element inside the scroll event listener, here are the results:

 

scrollTop: -29 app.js:3
scrollTop: -33 app.js:3
scrollTop: -36 app.js:3
scrollTop: -38 app.js:3
scrollTop: -46 app.js:3
scrollTop: 0 app.js:3
scrollTop: -54 app.js:3
scrollTop: 0 app.js:3
scrollTop: -64 app.js:3
scrollTop: 0 app.js:3
scrollTop: -76 app.js:3
scrollTop: 0 app.js:3
scrollTop: -84 app.js:3
scrollTop: 0 app.js:3
scrollTop: -88 app.js:3
scrollTop: 0 app.js:3
scrollTop: -89 app.js:3
scrollTop: 0 app.js:3
scrollTop: -88 app.js:3

It seems like the scrollTop property of that div element is jumping to 0 at random times when I pull down. The same thing is happening with my application. I ran this on the 10.2.1.1925 simulator. Version 10.2.0.1791 of the simulator showed similar results.

Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: scrollTop property randomly going to 0

I can confirm this behavior does not occur on a live device.  That's unfortunate that it does on the simulator as it introduces some confusion over expected versus actual results.

 

I expect there is a timing issue with an event handler in the simulator.

 

Thanks for reporting this.

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.