GithubHelp home page GithubHelp logo

Comments (8)

celsomtrindade avatar celsomtrindade commented on July 25, 2024 4

I can test it, but not very soon because I'm away. I'll try to give a feedback by tomorrow.

But that's correct, I can't scroll to the top of the page because when I try to do it, it activate the pull to refresh.

I'll try to play around with your tips and see if I can work around this. Not a big issue.

from nativescript-pulltorefresh.

celsomtrindade avatar celsomtrindade commented on July 25, 2024 2

Running into same issue. When using it with ScrollView or ListView, when trying to scroll back to the top it will refresh the page, ven when touching the screen at the very bottom. I'm using it with angular as well.

But I noticed it only happens when using with more layout definitions. For example, the code below works as expected:

<PullToRefresh (refresh)="refreshPage($event)">
    <ListView [items]="itemList" *ngIf="itemList.length > 0">
        <ng-template let-item="item">
            <Label [text]="item.name"></Label>
        </ng-template>
    </ListView>
</PullToRefresh>

However, this code here doesn't:

<PullToRefresh (refresh)="refreshPage($event)">
    <FlexboxLayout flexDirection="column">
        <ListView [items]="itemList" *ngIf="itemList.length > 0">
            <ng-template let-item="item">
                <Label [text]="item.name"></Label>
            </ng-template>
        </ListView>

        <Label text="Some other content"></Label>
    </FlexboxLayout>
</PullToRefresh>

Since there isn't much in the docs, I don't know if this is the expected behavior or if needs to fix something.

from nativescript-pulltorefresh.

PeterStaev avatar PeterStaev commented on July 25, 2024 1

The thing about iOS is that unlike Android you cannot use the pull to refresh functionality on any view, because the whole UI thing is rendered in UIScrollView. On Android it is just a separate UI element that is rendered at the top of any view, so it is independent. That's why for iOS the content of the pull to refresh needs to be a descendant of UIScrollView. In terms of {N} this means that inside the PullToRefresh you must have ScrollView or ListView. Also works with some plugins - for example my GridView plugin.

from nativescript-pulltorefresh.

bradmartin avatar bradmartin commented on July 25, 2024

I think this mainly affects iOS correct? I recall having to adjust layouts for iOS to work. This line is all I recall, maybe @PeterStaev can provide some insight on the specifics here for iOS 😄
I don't recall having any layout issues with Android but it's been awhile since I've used this one.

from nativescript-pulltorefresh.

celsomtrindade avatar celsomtrindade commented on July 25, 2024

For me this was happening on Android, I can't test it on IOS since I don't own one. Also, like I said, it only has a different behavior under the second template structure, and the pull refresh does work, but it blocks the scroll to top.

from nativescript-pulltorefresh.

bradmartin avatar bradmartin commented on July 25, 2024

Realized I forgot to paste the line from the iOS file like 😄 @PeterStaev but thanks for chiming in on the iOS specifics. @celsomtrindade when you say it blocks the scroll to top you mean you can't scroll back to the top of the list, correct? Does it work with a StackLayout instead of FlexboxLayout? Maybe wrap the Listview and label inside a ScrollView 🤔 just some thing I would try if I was working on this. Let me know if you can try any of those and report any findings back. Thanks 😄

from nativescript-pulltorefresh.

william-levi avatar william-levi commented on July 25, 2024
  • 1 any workaround for this ? i'm also using scrollview

from nativescript-pulltorefresh.

markosole avatar markosole commented on July 25, 2024

Hi guys, looks like this is still a problem. It works fine with Repeater and RadListView, but does not with ListView. I did not find any workaround. I m thinking to try with checking scroll position (check this out for idea: https://www.youtube.com/watch?v=k9cxGlAlo4s&t=1029s). All we need is to check scroll position and enable or disable plugin.

Scroll Up get's locked. You need to start scrolling down and than just change direction while you keep the finger on the screen. Looks like that it can't get actual scroll position.

from nativescript-pulltorefresh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.