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

InvalidPointerId on Android 6 #1086

Open
elektray opened this issue Jan 18, 2017 · 5 comments
Open

InvalidPointerId on Android 6 #1086

elektray opened this issue Jan 18, 2017 · 5 comments

Comments

@elektray
Copy link

elektray commented Jan 18, 2017

This is strange...

Bxslider was working all nicely on Android since today where on touch event of the carousel it fires this error "Invalid Pointer Id: Failed to execute 'set Pointer Capture' on 'Element': Invalid Pointer Id."
Looking at the bxslider script this is the code where the error fires:

 if (slider.viewport.get(0).setPointerCapture) {
      slider.pointerId = orig.pointerId;
      slider.viewport.get(0).setPointerCapture(slider.pointerId);
    }

Any clue on what is going on?

@elektray
Copy link
Author

elektray commented Feb 1, 2017

Anyone can help me here?

Bxslider is the only slider that works for me, so I'm a bit desperate.

@simplicitytrade
Copy link

simplicitytrade commented Feb 1, 2017

To prevent the error you could use this snippet.

var chromePointerEvents = typeof PointerEvent === 'function'; if (chromePointerEvents) { if (orig.pointerId === undefined) { return; } }

Insert before LINE 1110:
touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig];

of this file:
https://github.com/stevenwanderski/bxslider-4/blob/master/dist/jquery.bxslider.js

(no "official" bugfix, just a workaround for myself)

Works for me in Chrome-Browser (v55 and v56, Mac). "onTouchStart" is triggered twice in this Browser-Version im mobile emulation, once with "PointerEvent"-Event, where the "pointerId" is missing, so the following code will fail at some point.

@elektray
Copy link
Author

elektray commented Feb 1, 2017

Thanks for that. You saved me hours of pain!
It works, finger crossed it will last.
Just a quick note for other people, it's after line 1110 and not before ;)

@bbceg
Copy link

bbceg commented Apr 17, 2017

Not sure if it's worth updating the issue title to mention that this bug can be reproduced in Chrome using the mobile devices emulator. By trying various older versions it would appear it was introduced between version 4.2.1 and 4.2.3 (4.2.2 didn't appear to work at all for me).

On a related note, I notice bxslider.com is running v4.1.2, would it be worth updating that to use the latest release if not too onerous? It took me a while to realise why the examples were working when mine didn't.

Finally, I found it was only necessary to add the line to the onTouchStart function around line 1108 but so far I'm only testing in Chrome's mobile device emulator.

Hope that's helpful.

demoncodemonkey added a commit to demoncodemonkey/bxslider-4 that referenced this issue May 13, 2017
durr04 added a commit to durr04/bxslider-4 that referenced this issue Dec 12, 2017
lostip pushed a commit to wellbin/antena-bxslider that referenced this issue Jan 11, 2018
willnet pushed a commit to willnet/bxslider-4 that referenced this issue Feb 11, 2018
@RoySegall
Copy link

Worked for me as well. Thanks!

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

No branches or pull requests

4 participants