lichess-org / chessground

Mobile/Web chess UI for lichess.org
https://lichess.org
GNU General Public License v3.0
1.02k stars 262 forks source link

Wrong piece movement issue #241

Closed coffeeDev98 closed 1 year ago

coffeeDev98 commented 1 year ago

Hi @niklasf , I have been using chessground through another package pgn-viewer. Not exactly sure as to what is causing this issue. It is pretty consistently occurring. Any idea on why this could be occurring...?

Video of issue given below

https://user-images.githubusercontent.com/63295908/196850611-015fe8f1-72da-4855-9d9f-46b2b493d889.mov

ornicar commented 1 year ago

Please don't ping developers.

That would be due to the page layout shifting after chessground is initialized, and chessground didn't update the board coordinates.

What application is that, where can we see it?

Siderite commented 6 months ago

That would be due to the page layout shifting after chessground is initialized, and chessground didn't update the board coordinates.

This also causes issues in other places when something changes the layout. I've solved it by periodically checking the position of the board and triggering a body resize event when it changes, but I think this kind of functionality should be embedded in Chessground.

I don't understand why Chessground has to cache the board coordinates in the first place and not use the current ones.