watusi / jquery-mobile-iscrollview

JQuery Mobile widget plug-in for easy use of the iScroll javascript scroller.
407 stars 183 forks source link

listview items keep scrolling down off the screen/page using iscrollview #69

Closed darrenmcentee closed 11 years ago

darrenmcentee commented 11 years ago

Hi, there i have an issue with iscrollview, it may be a bug. I hope this is the correct place to ask?

I am using: PhoneGap/cordova v1.50 JQuery: v1.7.1. JQuery Mobile v1.1.1. JQuery-mobile-iscrollview, v1.2.5

Code paste: http://pastebin.com/qqY5LmVQ

I have a page listed with data-role="listview"... its contains many items. When you scroll down to the bottom of the list, sometimes it scrolls down way past the last item on the list, and the page displays page BG, and it gets "stuck" (i.e. you cant grab the page to drag back up) Please see screen shots attached (in sequence going down). Is this a known bug, or something new? Code in on the paste-bin link above. Any info appreciated.

Thanks, Darren.

EDIT: I have noticed that when you switch the device from vertical then horizontal, then flip back to vertical orientation, the problem does not occur then.

device-2012-12-18-124444

device-2012-12-18-124503

device-2012-12-18-124514

device-2012-12-18-124524

device-2012-12-18-124558

darrenmcentee commented 11 years ago

To follow up here, and after some testing on a few devices, I've can reproduce the error and prevent it. It only seems to happen when I have one/some of the selected leagues filtered out. i.e in its settings i can set one of the leagues properties is set to 0 (checkbox not checked). (this just hides that list-view item (via an id) The error occurs then. If all preferences are set to be shown (all selected by default (all list-view item div's shown), then the error doesn't occur. Thus, it has to be something with the dynamic missing divs, being hidden via the preferences.

So, what does iScrollView need to have on the page to render and operate correctly? Thanks, Darren.

jtara commented 11 years ago

When you expand and collapse items inside the scroller, jQuery Mobile should send an updatelayout event, and iscrollview will respond to that.

If you are using some other method to show/hide some element(s) then you will need to call refresh() on the scroller in order to let it know that the content height has changed.

Or, you can trigger updatelayout on the element whose height has changed, and iscrollview should respond to that.