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

use drag and drop html api #97

Open
isaacl opened this issue Jul 1, 2019 · 9 comments
Open

use drag and drop html api #97

isaacl opened this issue Jul 1, 2019 · 9 comments
Labels

Comments

@isaacl
Copy link
Member

isaacl commented Jul 1, 2019

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

@ornicar
Copy link
Collaborator

ornicar commented Jul 3, 2019

Pretty sure it's a bad idea, but feel free to try

@isaacl
Copy link
Member Author

isaacl commented Jul 4, 2019

@ghost
Copy link

ghost commented Dec 2, 2019

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

@niklasf
Copy link
Member

niklasf commented Dec 2, 2019

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.

@LeoDog896
Copy link
Contributor

@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 1718+)
Opera 55+ Reasonable support
Safari 11.1+ Reasonable support

@benediktwerner
Copy link
Member

Note that the previous comment is more than 3 years old.

@LeoDog896
Copy link
Contributor

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 :+!:

@niklasf
Copy link
Member

niklasf commented Feb 19, 2023

I do remember that I just tried some demo myself back then. Trying another random demo today, I don't see the same problem.

@isaacl
Copy link
Member Author

isaacl commented Feb 19, 2023

there's some snippets here: 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.

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

No branches or pull requests

5 participants