slideout icon indicating copy to clipboard operation
slideout copied to clipboard

Prevent triggering open/close events while dragging vertically

Open joelray opened this issue 10 years ago • 10 comments

During touchmove events, vertical dragging should be detected to eliminate any cases of unwanted Slidemenu open/close events.

joelray avatar Jul 15 '15 17:07 joelray

+1

MitchellBouwman avatar Aug 05 '15 07:08 MitchellBouwman

+1

a-tarasyuk avatar Sep 23 '15 05:09 a-tarasyuk

+1, this is a constant complaint in our implementation of slideout.js, and having this addressed would complete its functionality for us :smile:

julianlam avatar Oct 04 '15 10:10 julianlam

+1

fspoettel avatar Oct 04 '15 10:10 fspoettel

+1 It would be nice to have horizontal threshold option.

rasitozcan avatar Apr 21 '17 11:04 rasitozcan

Still no response after almost 2 years. Do people already have alternatives?

MitchellBouwman avatar May 18 '17 10:05 MitchellBouwman

More than two years. This is a major pain too.

dhamaniasad avatar Nov 14 '17 10:11 dhamaniasad

You can disable touch event initially and enable it only when slideout is openned.

var slideout = new Slideout({
    ...
});

slideout.once('open', slideout._initTouchEvents);
slideout.on('open', slideout.enableTouch);
slideout.on('close', slideout.disableTouch);

dinhtungdu avatar Jun 11 '18 09:06 dinhtungdu

I'd also be interested in hearing if anyone had a better solution for this.

Velora avatar Aug 19 '18 17:08 Velora

This is not a perfect solution, but to fix some unintended opening of slideout, you can increase the pixel value required for the swipe to trigger slideout.

Line 271 in the current distribution has a default of 20 pixels movement to start opening slideout:

if (Math.abs(dif_x) > 20) {

Currently I am experimenting with setting this number to 40 so that slideout doesn't get triggered as often with small horizontal swipes or when scrolling vertically with a diagonal swipe.

Keep in mind that slideout will immediately snap the panel to this position. So, if you were to set a high value here, not only would it require a large swipe for the user to see indication of the slideout feature, but it would also mean that you would lose some of the smoothness of the opening effect.

Velora avatar Aug 19 '18 18:08 Velora