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.

When using touch, if you stop moving your finger it won't snap

See original GitHub issue

I am currently looking into this, but figured more eyes is better, so I’m submitting an issue.

Description

So if you’re using a touch device or touchpad on a laptop, if you stop scrolling with your finger (keep it still and on the screen / touchpad) before you release it from the surface, it will scroll as per normally, but it won’t snap to a panel. Here is how I initialize panelsnap

//Panelsnap Initialization

var sectOffset = $(window).height() * 0.15;

jQuery(function($) {
    $('body').panelSnap({
        delay: 5,
        directionThreshold: 1,
        offset: sectOffset
    });
});

I realize this is probably a weird initialization, but I’m doing something a little outside the usual, so yeah.

My Findings

I’ve found that in this situation where there’s an issue, the scrollStop() function isn’t called, which leads me to believe that the event isn’t fired. Perhaps then another event listener needs to be added, or the event listener that this function is bound to needs to be changed.

I’m not intimately familiar with this domain, so I’ll do some research and update this if I find a solution. That being said, I’m not sure I will be able to check whether or not this breaks other implementations.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tortilamancommented, Apr 23, 2016

So I figured out the issue. I haven’t thoroughly tested this yet, but tentatively it’s a relatively simple fix. I would give line numbers, but I’m sure they’re different at this point. I can submit a pull request as well if you’d like. Inside the definition of scrollStart and scrollStop changes have been made here around like 630:

$this.on('touchleave touchcancel touchend', function(event) {
    isTouching = false;
    /*setTimeout(function () {
        clearTimeout(timer);
    }, 50);*/
});

$this.on('touchend touchmove scroll', function(event) {//NOTE: Added touchend
    if (isTouching && event.type != 'touchend') {//NOTE: Added second condition.
        return;
    }

Ended up being more straightforward than I thought once I found my way through the code.

0reactions
tortilamancommented, May 9, 2018

Good to hear this worked out, thanks for the update @guidobouman!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trigger finger - NHS
Symptoms of trigger finger can include pain at the base of the affected finger or thumb when you move it or press on...
Read more >
Trigger Finger: Symptoms, Causes, and Risk Factors
a clicking or snapping noise with movement; stiffness in your finger. If you don't get treatment for it, trigger finger can progress. Advanced...
Read more >
Why Your Finger Joints Click, Snap, and Pop - Verywell Health
Many people can make their fingers pop and snap, often called cracking knuckles. The sound you hear is caused by nitrogen, oxygen, ...
Read more >
Use AssistiveTouch on your Apple Watch - Apple Support
Open the Settings app on your Apple Watch. Tap Accessibility, then tap AssistiveTouch. Tap AssistiveTouch to turn it on, then tap OK to ......
Read more >
How to Snap Your Fingers: 9 Steps (with Pictures) - wikiHow
Move your index finger down so it rests against your thumb without letting up on the pressure. Move the thumb from the middle...
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