Giter Club home page Giter Club logo

Comments (8)

Bernardo-Castilho avatar Bernardo-Castilho commented on August 13, 2024 1

This is strange. I have a Surface with a regular touch screen, and the sample works for me:

http://bernardo-castilho.github.io/DragDropTouch/demo/index.htm

In fact, the polyfill is not even needed in that case. The browser supports HTML5 drag/drop events by default.

I do like the Pointer events, and hope all browsers will support them soon, including drag/drop events.
When that happens, the world will be a better place, with cleaner and more standard code, and fewer polyfills ;-)

from dragdroptouch.

frabie avatar frabie commented on August 13, 2024 1

It seems Google has dropped support of ontouch API in chrome release 70 www.chromestatus.com/feature/4764225348042752). This polyfill does not work anymore on touch enabled windows tablets with newer Chrome versions. As a workaround I would propose to change the check whether touch is available in this way: if (window.PointerEvent || 'ontouchstart' in document).

This works for me but it is still not perfect because it doesn´t solve the issue in Edge.

from dragdroptouch.

Bernardo-Castilho avatar Bernardo-Castilho commented on August 13, 2024

Thanks for bringing this up. Fortunately, IE and Edge do support touch-based drag and drop on devices with touch screens, so the polyfill is not needed there.

from dragdroptouch.

jboler avatar jboler commented on August 13, 2024

@Bernardo-Castilho I have a Surface Book and your demo page doesn't work on IE11 or Edge using the touch screen. This is because IE11/Edge doesn't support the touch events API, it only supports the pointer events API.

Your demo does work in Chrome on my Surface Book because Chrome supports both touch & pointer events.

Firefox is soon to enable their PointerEvents API implementation which will mean that all 4 major browsers on Windows have native Pointer Events support leaving only Safari iOS & Chrome Android that don't and there's a solid polyfill for those. I think the best way forward to support touch will be to use Pointer Events.

from dragdroptouch.

gnapse avatar gnapse commented on August 13, 2024

FWIW, I just tried this repo's demo page on IE 11 on a touch-enabled Windows laptop. The drag and drop works when using the touchpad, but not when attempting to drag and drop by interacting with the draggable elements via touching the screen.

from dragdroptouch.

Herst avatar Herst commented on August 13, 2024

I can confirm what @gnapse said, the demo page does not work in IE11 or Edge.

So I did some more testing of desktop setups with your demo and the demo with just the HTML 5 events (the native version, the one you used as a basis) and my own project where I only used the native events for now and I'm now trying to make compatible with more browsers, there are two things I noticed:

  • The native version does not work in Edge (dragging does but drop has no effect) either but it does work in my own project.

  • The native version using mouse (or touchpad/trackpoint) does not work on IE11 (!). And in my own project dragging seems to work but not dropping (perhaps it has something to do with the code for making sure that the right stuff is being dragged into it).

(Newest IE11 and Edge on Win 10 with Creators Update on a touch-enabled device BTW.)

Apart from that it enables touch drag&drop in Chrome on Linux/Windows and Firefox on Windows where it previously wouldn't work with just native events (native with Firefox on Linux works when some requirements are met [GTK3, multi-process] which was the case for me).

from dragdroptouch.

Bernardo-Castilho avatar Bernardo-Castilho commented on August 13, 2024

Did you try using navigator.maxTouchPoints as the article suggested?

BTW, most Edge issues should go away soon. I've been using the new Chromium-based version and it's great! ;-)

from dragdroptouch.

frabie avatar frabie commented on August 13, 2024

navigator.maxTouchPoints standalone does not work in Firefox66.
On mobile devices the polyfill works parallel to the native browser implementation. Shorttouch activates the polyfill, longtouch activates the native implementation.

The best solution would be to find a way to disable this polyfill on mobile devices and using their own native browser implementations. E.g. if (window.orientation == undefined ) could solve this issue but it is deprecated and I don´t know how it works on chromebook tabs.

from dragdroptouch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.