Jquery Mobile Scrollview list height bug - jquery-mobile

When I load the page, my scrollview works perfectly, but when I navigate away from the main page and I try to return to it, the scrollview forgets where the top of the scrollview ought to be. It thinks that the place that I left the scrollview at before navigating away is the top of the list, and it thinks that the bottom of the list is somewhere beyond where the bottom actually is, thus it allows the user to scroll to far and then the scrollview disappears and cant be recovered unless i call scrollTo in the console.
I have tried doing scrollTo(0,0) on pagehide and beforepagehide with no luck -- the page will begin at the top when its shown, but it will immediately scroll down.
Here's how to reproduce the issue:
1) Go to http://7.latest.foodtrucksmap.appspot.com/m/la
2) Scroll down the list and select the detail disclosure on one of the cells.
3) Hit the 'Map' icon in the header to return to the original view.
At this point the scrollview will be in the state I've described.
Thanks a lot for the assistance in getting this resolved.

I resolved this by calling $('#list_content').scrollTop(0) on pageshow

Related

Add refreshControl to a scrollView with pageControl

As it can be seen in the gif from the link, I was able to add the refresh control to the scrollView but it is only shown for the first page. It still works for the other pages but it is not showing the refresh indicator which might be confusing for the user.
I have tried already a couple of ideas but nothing seems to work.
I am looking for a solution, which either only makes it possible to use the refresh control on the first page and disables vertical scrolling for the other pages or a solution which shows the refresh indicator at every page.
I would also like to disable the diagonal dragging. I added this in case there is a solution which solves both problems.
https://giphy.com/gifs/KfqJnVlwKE9fwFc07R/html5
Help will be very appreciated.
The indicator looks like it is probably added as a child of the scrollview, meaning it is scrolled along with the other contained views, and hence scrolled off-screen.
For an element you want to always be displayed over the scroll view add the indicator as a sibling of the scroll view (i.e. a subview of the scroll view's parent).

React-Native scrollToEnd on iOS behaves differently than scrolling manually, putting items to bottom

Please consider this example on iOS: https://sketch.expo.io/SyeyMSx_il
Try to scroll manually, everything looks normal: No comments message stays on top.
If you click now on the button now, the No comments message sticks to the bottom.
If you scroll manually again, everything goes normal again.
Why using scrollToEnd should be different than scrolling manually? And how to fix this weird behaviour?
Adding to ScrollView contentContainerStyle={{ flexGrow: 1 }} fixed that.
See now: https://snack.expo.io/HkdP9_e1Z
I'm not sure of the cause of the behaviour without digging through the source code for ScrollView but you could get around it by making a function that handles the scroll to end, only triggering it if the size of the contents are greater than the size of the viewport.

Move to Specific Page in ScrollView While Hiding Between Pages - iOS

I have Paged UIScrollVIew with 5 pages.
I have a problem where when I tap a button, I need to navigate from the 1st to 4th page. The problem is that it will show page 2 & 3 during this transition. I just want it to scroll to page 4 as if it were the next page in the scroll view.
Here is a diagram:
Any idea's on how to achieve this?
I think you'll have to reposition your pages within the scroll view to make that happen seamlessly. It probably means keeping track of what pages you've moved and perhaps a state engine that restores your original positions when you leave. It would probably be easier to make each page a subview and add that to your scroller, then you need just change each subviews frame as needed.

UIAutomation and reading static text in scroll view

I'm doing some UIAutomation testing using Xcode Instruments and have an issue accessing a staticText which I want to verify.
The situation:
I have some buttons that display different scroll views that contain multiple charts. These scroll views have 5+ items in each so when i initially do target.logElementTree() it only shows the visible ones. If i scroll down with window.scrollViews()[0].scrollDown() and again get a logElementTree() the bottom elements are shown however whenever i try to access them it keeps referring to the ones from the top of the scroll view.
Any ideas?
Cheers.
As per as my experience, whenever you do "taregt.logElementTree()", it will display you all the elements (visible & hidden or which are present even at the bottom of screen) which you can access by its name or index or position once scrolled down. But if you still face problem, I will recommend you to access the element by its position after scrolling down to make it visible.

jQuery jquery.mobile-1.0rc3.min.js new page scrolling to top

There's a billion scroll to's in this file. I'm trying to stop it from forcing you to the top every time the page changes. I even disabled the scroll to after the comment that says "Scroll to top, hide addr bar" but it hasn't stopped it. It's annoying to scroll down while the page is loading and then be forced back to the top when it completes loading. Anyone know what in there needs to be commented out?

Resources