ianfab / fairyground

playground for Fairy-Stockfish in the browser
https://fairyground.vercel.app/
GNU General Public License v3.0
20 stars 5 forks source link

Start game messes up coordinate mapping #35

Open ianfab opened 9 months ago

ianfab commented 9 months ago

Sometimes after clicking "Start game" the coordinate identification seems to be messed up as can e.g. be seen by right clicking on the board, making it impossible to move properly. Any zooming or scrolling either before or after clicking "Start game" seems to fix it. Potentially an interference with hiding of elements on start of game?

yjf2002ghty commented 9 months ago

I've never seen such problem in my environment. I've tested the program on: Google Chrome 117.0.5938.134 Microsoft Edge 117.0.2045.40 Probably this is caused by the browser itself. I think a solution for this is to scroll the page to the top after hiding the elements.

window.scrollTo(0,0);
ianfab commented 9 months ago

I can reproduce this with Chrome/Chromium on Windows, Linux, and Android, as well as with Edge on Windows, so I thought it should be reproducible across most browser versions. Yeah, just forcing a scroll might be sufficient as a workaround.

dpldgr commented 9 months ago

This bug appears on my Windows 10 Pro desktop using Chrome 117.0.5938.149 and scrolling also fixes it for me. It seemed to appear after some time, so I'm not sure how you'd automatically detect that the bug has been activated and needed fixing with a scroll.