Prevent swipe direction

4 posts, 0 answers
  1. Steve
    Steve avatar
    1869 posts
    Member since:
    Dec 2008

    Posted 15 Mar 2016 Link to this post

    Docs show items can be swiped left and right, I just want to limit it to swipe right, and not ever have it "stick" open... do you know what I mean?  Like if swiped 50% over, then preform the swipe end action?

    Struggling with this a bit...

  2. Deyan
    Admin
    Deyan avatar
    2140 posts

    Posted 18 Mar 2016 Link to this post

    Hell Steve,

    Take a look at the source of one of RadListView's examples in {N}'s marketplace demo:

    https://github.com/NativeScript/nativescript-marketplace-demo/blob/production/app/examples/listview/reorder/listview-reorder.ts

    You can try setting the corresponding property of the swipeLimits object to 0 to prevent the item from being swiped in the given direction:

    export function onItemSwipeProgressStarted(args: listViewModule.ListViewEventData) {
        args.data.swipeLimits.threshold = todoList.getMeasuredWidth() * utils.layout.getDisplayDensity();
        args.data.swipeLimits.left = 350 * utils.layout.getDisplayDensity();
        args.data.swipeLimits.right = 350 * utils.layout.getDisplayDensity();
    }

    I hope this helps.

    Regards,
    Deyan
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Steve
    Steve avatar
    1869 posts
    Member since:
    Dec 2008

    Posted 31 Mar 2016 in reply to Deyan Link to this post

    Were can we do a feature request to move this to a root level API setting?  Maybe like swipeDirection="Both" ("Left" or "Right")

  4. Nikolay
    Admin
    Nikolay avatar
    1805 posts

    Posted 06 Apr 2016 Link to this post

    Hi Steve,

    You can use the following dedicated github repository to submit feature requests and confirmed issues: https://github.com/telerik/nativescript-ui-feedback.

    Regards,
    Nikolay
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top