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

Has stop working in chrome after update? #309

Open
ghost opened this issue Nov 5, 2018 · 12 comments
Open

Has stop working in chrome after update? #309

ghost opened this issue Nov 5, 2018 · 12 comments

Comments

@ghost
Copy link

ghost commented Nov 5, 2018

After the last update of chrome (computer version) this plugin has stop working... testing the oficial website examples http://touchpunch.furf.com in mozilla works (same problem in Edge) is still working on touch devices, but using chrome (after the last update), seems not not to respond for example “drag and drop” or the other examples.

Tested on windows version (computer) connected to a Interactive Board Display, where worked fine until this update
On Android tablet works fine.

Has anyone experience the same issue?

@ghost ghost changed the title Has stop working in chrome after update Has stop working in chrome after update? Nov 5, 2018
@datalus
Copy link

datalus commented Nov 5, 2018

Hey @oscarabilleira ...

I think this library is largely unmaintained (don't quote me on that, I could be wrong!), but here in the touch punch code:

$.support.touch = 'ontouchend' in document;
you'll need to update that line since Chrome 70+ removed the ontouch*/touch* events.

I've changed it to $.support.touch = 'ontouchend' in document || navigator.maxTouchPoints > 0;

Hopefully they'll continue to support that property off the navigator object going forward ;)

@ghost
Copy link
Author

ghost commented Nov 6, 2018

Thanks...

I have made this changes but doesnt’t solve the problem

@mykophil
Copy link

mykophil commented Nov 6, 2018

Thanks. Same here.

@datalus
Copy link

datalus commented Nov 6, 2018

What device are you using? I was testing with a Chromebook C100PA. I was just using the draggable function from jquery UI for setting up our elements and it's working for me.

To clear up some confusion: They just removed the event property names from the window/document/element objects, so any feature detection like the above mentioned line will fail. The events still fire so if you bind them after detection it should resume proper behavior.

Blog post detailing change: https://blog.chromium.org/2018/09/chrome-70-beta-shape-detection-web.html

@ghost
Copy link
Author

ghost commented Nov 6, 2018

What device are you using? I was testing with a Chromebook C100PA. I was just using the draggable function from jquery UI for setting up our elements and it's working for me.

To clear up some confusion: They just removed the event property names from the window/document/element objects, so any feature detection like the above mentioned line will fail. The events still fire so if you bind them after detection it should resume proper behavior.

Blog post detailing change: https://blog.chromium.org/2018/09/chrome-70-beta-shape-detection-web.html

I’m using it in a “interactive board conected to a windows computer” (tested on chrome under android or ios devices works fine)

@jbuckshin
Copy link

Fix specified by @datalus worked for me. Device is Dell P2418HT + win7 + chrome 70

@ghost
Copy link

ghost commented Nov 12, 2018

This is probably overkill, but this worked for me (Surface + win10)

$.support.touch = ('ontouchstart' in document || 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0);

@ghost
Copy link
Author

ghost commented Nov 12, 2018

This is probably overkill, but this worked for me (Surface + win10)

$.support.touch = ('ontouchstart' in document || 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0);

I have tested this too and it doesn’t work

@jeongcatfish
Copy link

jeongcatfish commented Dec 13, 2018

Hey @oscarabilleira ...

I think this library is largely unmaintained (don't quote me on that, I could be wrong!), but here in the touch punch code:

jquery-ui-touch-punch/jquery.ui.touch-punch.js

Line 14 in 4bc0091

$.support.touch = 'ontouchend' in document;
you'll need to update that line since Chrome 70+ removed the ontouch*/touch* events.
I've changed it to $.support.touch = 'ontouchend' in document || navigator.maxTouchPoints > 0;

Hopefully they'll continue to support that property off the navigator object going forward ;)

It works!! thank you I've been looking for this solution. and it's really helpful :)

@abidCharlotte49er
Copy link

Oscarabilleira's suggestion worked. I remember we had to use MaxTouchPoints property in some other plugin where touch events are not registering.
People using min version copy paste below script and try. Thanks

!function (a) { function f(a, b) { if (!(a.originalEvent.touches.length > 1)) { a.preventDefault(); var c = a.originalEvent.changedTouches[0], d = document.createEvent("MouseEvents"); d.initMouseEvent(b, !0, !0, window, 1, c.screenX, c.screenY, c.clientX, c.clientY, !1, !1, !1, !1, 0, null), a.target.dispatchEvent(d) } } if (a.support.touch = ('ontouchstart' in document || 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0), a.support.touch) { var e, b = a.ui.mouse.prototype, c = b._mouseInit, d = b._mouseDestroy; b._touchStart = function (a) { var b = this; !e && b._mouseCapture(a.originalEvent.changedTouches[0]) && (e = !0, b._touchMoved = !1, f(a, "mouseover"), f(a, "mousemove"), f(a, "mousedown")) }, b._touchMove = function (a) { e && (this._touchMoved = !0, f(a, "mousemove")) }, b._touchEnd = function (a) { e && (f(a, "mouseup"), f(a, "mouseout"), this._touchMoved || f(a, "click"), e = !1) }, b._mouseInit = function () { var b = this; b.element.bind({ touchstart: a.proxy(b, "_touchStart"), touchmove: a.proxy(b, "_touchMove"), touchend: a.proxy(b, "_touchEnd") }), c.call(b) }, b._mouseDestroy = function () { var b = this; b.element.unbind({ touchstart: a.proxy(b, "_touchStart"), touchmove: a.proxy(b, "_touchMove"), touchend: a.proxy(b, "_touchEnd") }), d.call(b) } } }(jQuery);

@ghost
Copy link

ghost commented May 8, 2019

I had the same problem with Chrome but was able to make it work again by adjusting about://flags
"Touch Events API" set to "Enabled" rather than "Default/Automatic"

@littlecastrum
Copy link

I had the same problem with Chrome but was able to make it work again by adjusting about://flags
"Touch Events API" set to "Enabled" rather than "Default/Automatic"

This worked for me also

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

6 participants