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

Slide tolarance #105

Open
Erel0 opened this issue Oct 23, 2022 · 3 comments
Open

Slide tolarance #105

Erel0 opened this issue Oct 23, 2022 · 3 comments

Comments

@Erel0
Copy link

Erel0 commented Oct 23, 2022

I tried almost all slider plugins this is the best (working great resizing, ssr and other features) just one piece missing, slide tolarence option.

@weotch
Copy link
Member

weotch commented Oct 25, 2022

Thanks! What would that prop do? I'm unfamiliar with it.

@Erel0
Copy link
Author

Erel0 commented Oct 26, 2022

image

let's say user wants to add product to basket , when they click button or slider itself , drag:start will trigger after 5px movement . Because sometimes it will break @click event on slider itself .

@weotch
Copy link
Member

weotch commented Oct 26, 2022

What kind of markup are you using in those add to cart buttons? I've tried to handle this use case by preventing dragging on interactive elements and images here:

# Prevent the anchors and images from being draggable (like via their
# ghost outlines). Using this approach because the draggable html attribute
# didn't work in FF. This only needs to be run once.
preventContentDrag: ->
return if @contentDragPrevented
@$refs.track.$el.querySelectorAll 'a, img'
.forEach (el) -> el.addEventListener 'dragstart', (e) ->
e.preventDefault()
@contentDragPrevented = true

Maybe I need to add <button> to the list?

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