Skip to content

how to allow user to drag the card in left and right only not up and down  #4

Description

@subhash1478

hi @ksachdeva please help

I add allowedDirections but it does not work


    this.stackConfig = {
            allowedDirections: [  Direction.LEFT, Direction.RIGHT],

      throwOutConfidence: (offsetX, offsetY, element) => {
        // console.log('throwOutConfidence',offsetX, offsetY,  element)
        return Math.min(Math.abs(offsetX) / (element.offsetWidth / 5), 1);
      },
      transform: (element, x, y, r) => {
        //         console.log('transform')
        this.onItemMove(element, x, y, r);
      },
      throwOutDistance: (d) => {
        //                   console.log('throwOutDistance')
        return 800;
      }
    };

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions