[Help]: Class is-dragging
applied before dragging start
#834
-
SummaryNot sure if this qualifies as a bug so opening discussion. The class It would make more sense to apply it on drag start as supposed to pointerDown so that the class is not applied on a simple click. This is causing an issue for my implementation where I need to disable pointer events on slides while dragging to prevent unwanted slide hover behavior, so using the class See minimal reproduction: https://stackblitz.com/edit/github-it9kus?file=app.vue Notice how everything works as expected WHILE dragging, but clicking a slide doesn't do anything, I would expect it to open the link. If applicable, which variants of Embla Carousel are relevant to this question?
Additional informationNo response CodeSandbox example |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
@meirroth I agree that the naming is unfortunate. The purpose of the I'm open to renaming this in the next major version. For example: let isDragging = false
emblaApi.on('scroll', (emblaApi) => {
isDragging = emblaApi.internalEngine().dragHandler.pointerDown();
});
emblaApi.on('pointerUp', () => {
isDragging = false
}) Best, |
Beta Was this translation helpful? Give feedback.
@meirroth I agree that the naming is unfortunate. The purpose of the
dragging: is-dragging
is actuallypointerDown: '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:Best,
David