Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'reorder' is raised on click without delay #104

Open
Samlibardi opened this issue Jul 12, 2018 · 0 comments
Open

'reorder' is raised on click without delay #104

Samlibardi opened this issue Jul 12, 2018 · 0 comments

Comments

@Samlibardi
Copy link

Problem: Clicking an element in a Slip list without delay triggers a 'reorder' event. This happens because there is no detection whether the element actually gets dragged around or if it's released in the same place it was before. This causes some implications:

What should happen: clicking raises a click, reorder should only be raised when the element is actually dragged around.

To solve: Some dragging checks before putting Slip into reorder state. My workaround is the following code in the 'undecided' state:

var delayed = true;
if (!this.dispatch(this.target.originalTarget, 'beforewait', {'isTouch': isTouch})) {
  if (this.dispatch(this.target.originalTarget, 'beforereorder')) {
    delayed = false;
    //this.setState(this.states.reorder);
}

...

onMove: function() {
  var move = this.getAbsoluteMovement();
  if (!delayed && move.y > 5) {
    this.setState(this.states.reorder);
  }

I've seen some bugs in this workaround though.

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

No branches or pull requests

1 participant