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

useDraggable will trigger a click event after each drag and drop completion #3901

Open
7 tasks done
3261564019 opened this issue Apr 1, 2024 · 1 comment
Open
7 tasks done

Comments

@3261564019
Copy link

Describe the bug

how to retain click events while retaining drag and drop functionality

Reproduction

no

System Info

no

Used Package Manager

npm

Validations

@Nomango
Copy link

Nomango commented Apr 10, 2024

Can't find an elegant solution. There is a temporary approach.

const isDragging = ref(false);

useDraggable(dragger, {
  onMove: () => {
    isDragging.value = true;
  },
  onEnd: () => {
    setTimeout(() => {
      isDragging.value = false;
    }, 100);
  },
});

function onClick() {
  if (!isDragging.value) {
    // do sth
  }
}

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

2 participants