Open isaacl opened 5 years ago
Pretty sure it's a bad idea, but feel free to try
see also https://medium.com/backticks-tildes/drag-and-drop-with-html5-368a1bb72881 and the possibly obsolete https://www.useragentman.com/blog/2010/01/10/cross-browser-html5-drag-and-drop/ which supports IE
This doesn't work by the way if the Windows Classic theme is enabled, although it seems smoother with html api. Also it might be possible to check if the classic theme is enabled and fall back to the default dragging method: https://stackoverflow.com/questions/2450133/javascript-detect-if-xp-or-classic-windows-theme-is-enabled
So whether or not native drag/drop will work, depends on multiple factors (not for Windows Classic, not for X11 (maybe only i3), ...) that are impossible(?) to detect. So it does not seem feasible for now, even as progressive enhancement.
@niklasf where did you get the info that it doesn't work for X11? It usually works for me quite fine. (Can't ping since ghost) but can someone else triage that? The only place I can find that drag and drop for Windows Classic doesn't work is this issue, surprisingly.
It'll require edge 18+, but other than that, it doesn't break much else from a glance in the caniuse website.
Name | Version | Notes |
---|---|---|
Chromium / Chrome | last 10 | Full support |
Firefox | 63+ | Full support (fastest local analysis since FF 79) |
Edge | 91+ | Full support (reasonable support for |
Opera | 55+ | Reasonable support |
Safari | 11.1+ | Reasonable support |
Note that the previous comment is more than 3 years old.
Note that the previous comment is more than 3 years old.
I somehow acknowledged this and yet failed to realize that "hey maybe this implies they don't remember where they got it from". In that case, it seems that now there's not really much compatibility against the drag and drop API. It should be ready to use :+!:
I do remember that I just tried some demo myself back then. Trying another random demo today, I don't see the same problem.
there's some snippets here: https://github.com/lichess-org/chessground/compare/master...isaacl:chessground:dragDrop
of an attempt I tried a couple years ago. Even with full support, browsers centered the hover icon differently, and I was forced to use different behavior for different browsers. But I still recon it's doable.
Drag and Drop api is pretty well supported. It would allow dragged pieces to track more closely to mouse pointer, making for smoother piece movement.
https://caniuse.com/#search=draganddrop
cc @niklasf