Skip to content

[Help]: Class is-dragging applied before dragging start #834

Closed Answered by davidjerleke
meirroth asked this question in Help
Discussion options

You must be logged in to vote

@meirroth I agree that the naming is unfortunate. The purpose of the dragging: is-dragging is actually pointerDown: 'is-pointer-down'. It's used to style the pointer on desktops, cursor: grabbing; is often used for this:

I'm open to renaming this in the next major version. For example: pointerDown would be more accurate. In your case, you can solve it like this:

let isDragging = false

emblaApi.on('scroll', (emblaApi) => {
  isDragging = emblaApi.internalEngine().dragHandler.pointerDown();
});


emblaApi.on('pointerUp', () => {
  isDragging = false
})

Best,
David

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@meirroth
Comment options

@davidjerleke
Comment options

@meirroth
Comment options

@davidjerleke
Comment options

@meirroth
Comment options

Answer selected by meirroth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
resolved This issue is resolved question Question about how to achieve something
2 participants