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

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

Open
tiangolo opened this issue Mar 22, 2016 · 0 comments
Open

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

tiangolo opened this issue Mar 22, 2016 · 0 comments

Comments

@tiangolo
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant