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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent click events from firing on the draggable and/or childs #159

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

houtan-rocky
Copy link
Contributor

No description provided.

Copy link

changeset-bot bot commented Apr 23, 2024

鈿狅笍 No Changeset found

Latest commit: bcdcedb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Apr 23, 2024

@houtan-rocky is attempting to deploy a commit to the Purus Projects Team on Vercel.

A member of the Team first needs to authorize it.

@PuruVJ
Copy link
Owner

PuruVJ commented Apr 23, 2024

In the example in +page.svelte, if I click on the box, it should just trigger console.log('clicked'), but it doesn't. Similarly, the div inside it should also trigger its click. We only want the dragging to happen alongside the click events.

I think stopping propagation isn't the right step here. Maybe we should harness the delay PR #157, set it to a default of 33-50ms(average duration of a single click) and work with that

Edit: It seems if I press my trackpad fully, it takes 90-100ms for one click. if I just tap it, its less than 10ms. Maybe the default should be 100 馃 https://stackblitz.com/edit/vitejs-vite-nfx4kq?file=src%2FApp.svelte

@houtan-rocky
Copy link
Contributor Author

houtan-rocky commented Apr 23, 2024

@PuruVJ The type of hold we need to fix this is releaseTimeout, cause the ( unexpected ) click happens after dragEnd ( apparently is default behavior event with vanillajs ), and the delay #157 makes is on dragStart.

@houtan-rocky houtan-rocky force-pushed the fix/130/click-called-ondragend branch from 1ee8781 to bcdcedb Compare April 23, 2024 13:59
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

Successfully merging this pull request may close these issues.

None yet

2 participants