When using touch, if you stop moving your finger it won't snap
See original GitHub issueI 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:
- Created 7 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top GitHub Comments
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:
Ended up being more straightforward than I thought once I found my way through the code.
Good to hear this worked out, thanks for the update @guidobouman!