Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set pointer capture on the right target #1255

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

NavidZ
Copy link

@NavidZ NavidZ commented May 15, 2019

Set the pointer capture on the slider itself only
when we are in the swiping mode. This ensures not only
clicks would work on elements such as links within the
slider if user hasn't moved the pointer, but also
disable activating and navigating to the links within
the slider if the user has started the slider move on
an embedded link within the slider.

Fixes #1240

Set the pointer capture on the slider itself only
when we are in the swiping mode. The ensures not only
clicks would work on elements such as links within the
slider if user hasn't moved the pointer, but also
disable activating and navigating to the links within
the slider if the user has started the slider move on
an embedded link within the slider.
// record the starting touch x, y coordinates
slider.touch.start.x = touchPoints[0].pageX;
slider.touch.start.y = touchPoints[0].pageY;

if (slider.viewport.get(0).setPointerCapture) {
// This captures the event stream to the target to make sure even if the pointer leaves
// the slider bounday in the very next move it still keeps the events.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo. Meant boundary?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@@ -30,6 +30,7 @@
responsive: true,
slideZIndex: 50,
wrapperClass: 'bx-wrapper',
sliderSlopSize: 5,
Copy link

@aleksandrs-ledovskis aleksandrs-ledovskis May 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I see, all current configuration options have some description in respective README section.

Could you add a short note/confirm what the "slop" value controls (move threshold to discern between slide/click) and what dimensions (pixels) it's measured in?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. I missed it. I didn't know. I added one, Does that sound good?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Hoping that any of project's maintainers can now race ahead with PR merge and new release 🤞

@ishpagin
Copy link

Looking forward for this fix

@bartvhooft
Copy link

Can we release it already? :D

@redhotbeani
Copy link

Yes, please release. We're already using this fix because tablet users (Android & Chrome browser) had difficulty clicking items in the slider area.

@NavidZ
Copy link
Author

NavidZ commented Sep 23, 2019

I'm glad the fix works for you. But this library doesn't seem to be maintained by the owner anymore and hence why this change and others are just sitting with no merge. I suggest you find another library that is actively being maintained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Links in sliders aren't working - Error in the latest version of Chrome (73.0.3683.75)
5 participants