question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Swiping triggers click, not always wanted

See original GitHub issue

A change from 1.3.10 where you removed return false is giving me a behavior I don’t want.

Swiping a video counts as a click and plays the video offscreen: http://codepen.io/matthewlein/pen/miFJs

It could be the wistia.js code doing weird stuff, but 1.3.10 was perfect for me. Could this click behavior be opted in or out, or as an alternative the return false, could you instead use a custom event like .trigger('slideClick.slick') or something like that to give people a click hook?

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:1
  • Comments:21 (6 by maintainers)

github_iconTop GitHub Comments

27reactions
andreibancioiucommented, Jun 6, 2017

Code for the already described solution:

carousel.slick();

var isSliding = false;

carousel.on('beforeChange', function() {
    isSliding = true;
});

carousel.on('afterChange', function() {
    isSliding = false;
});

carousel.find(".foo").click(function() {
    if (isSliding) {
        return;
    }
    
    // ...
});
3reactions
f-koernercommented, Nov 16, 2018

After searching two days i found this and it helps. What i needed to, was to stop the Default Event while sliding like: carousel.find(".foo").click(function() { if (isSliding) { event.stopImmediatePropagation(); event.stopPropagation(); event.preventDefault(); return; } });

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using swipe to trigger click - jquery - Stack Overflow
I've tried the following but to no avail. Any suggestions would be greatly appreciated. My existing code is a simple link with an...
Read more >
Swiping Back Button Sometimes Triggers Recent Apps To ...
The problem only occurs when swiping to the left first and up and not straight up. It seems like they added this left...
Read more >
Using Swipe to Trigger Contextual Actions
Implementations of swipe-to-delete or swipe to reveal contextual actions often suffer from usability problems.
Read more >
Create advanced animations with smart animate
Select Smart animate in the transition field to animate between two frames. ... In our example below, we have three frames with some...
Read more >
Prevent user from swiping through content with a trigger ...
For a course with navigation set to unrestricted: A trigger that disables the NEXT button does not disable swiping next. In other words,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found