Skip to content

Does it work on mobile devices? #74

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

Open
moroshko opened this issue Jun 18, 2014 · 5 comments
Open

Does it work on mobile devices? #74

moroshko opened this issue Jun 18, 2014 · 5 comments

Comments

@moroshko
Copy link

Hi,

Just wanted to know if "chessboardjs" is working on mobile, specifically the drag and drop functionality?

It would be nice to state in README.md in which browsers it was tested.

Thanks for this great project!
Misha

@oakmac
Copy link
Owner

oakmac commented Jun 18, 2014

It should work on mobile, although I have a limited number of devices to test it on.

Pretty sure chessboard.js works in IE8 and up.

I agree this information should be added to the README.

@osotorrio
Copy link

Hi,

I tested in an Android 7.0 with Chrome 60.0.xxx. The drag&drop moves the scroll vertically if the page has long content.

It would be nice if the pieces could also be moved first selecting the piece, and then clicking on the target square. It could be a config option apart of drag&drop.

Great job, anyway!!

@schttrj
Copy link

schttrj commented Oct 31, 2018

Hi,

I tested in an Android 7.0 with Chrome 60.0.xxx. The drag&drop moves the scroll vertically if the page has long content.

It would be nice if the pieces could also be moved first selecting the piece, and then clicking on the target square. It could be a config option apart of drag&drop.

Great job, anyway!!

Is there any solution to this? It's a great piece of software. If we could just make it so that the pieces can be selected first and moved to the specific square by clicking on that square. Thanks.

@hcgreier
Copy link

hcgreier commented Oct 22, 2022

Hi schttrj,

I made a litte site which provides saving chess diagrams as PNGs or JPGs.
Take a look here: Chess Problem Printer
(Sorry the site is in German, please use browser translator)

I made a switch (= just a beautified checkbox) on top of the board which sets CSS parameters to keep the webpage from scrolling. Switch on moblie mode, set up the pieces, switch off moblie mode. Simple as that.

Please tell if it works on your mobile devices.
greets,
hc

@kgcorner
Copy link

kgcorner commented Jan 7, 2023

I have fixed this issue and raised the PR #236
The culprit here is https://github.com/oakmac/chessboardjs/blob/master/lib/chessboard.js#L1658
According to the feature request on chrome call to preventDefault() becomes useless. It is simply ignored, and the screen stays scrollable.

In order to restore scroll freeze during drag event, you can use onDragStart call back to add CSS property overflow:hidden to body tag and remove this property on onSnapEnd or onDrop.

I used this and it works for me.

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