Skip to content

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

@subhash1478

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;
      }
    };

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