Skip to content
This repository was archived by the owner on May 27, 2021. It is now read-only.
This repository was archived by the owner on May 27, 2021. It is now read-only.

isUnderThreshold returns false for a card that didn't moved #83

@tiangolo

Description

@tiangolo

isUnderThreshold() doesn't check if the variable this.thresholdAmount exists before computing and ends up returning false when the card hasn't moved, when should return true if anything (if the card hasn't moved yet this.thresholdAmount is undefined).

My use case: I'm using the plug-in with a list of cards (not a "stack"). To do that I create a stack with just one card for each card. I modified the plug-in to use only dragright and dragleft to use only horizontal dragging and allow scrolling. But when I scroll the page, a dragend event is fired and since the card didn't move at all there is no this.thresholdAmount and the value of calling isUnderThreshold() is false. That triggers the onDestroy handler (in my case removing the card) while the card didn't even moved.

I'm submitting a PR to solve this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions