willb335 / chessboardjsx

:black_square_button: Chessboard built for React
https://chessboardjsx.com
MIT License
267 stars 79 forks source link

with animation, the transition duration creates a pause of exactly that time before each move #45

Open sherriff93 opened 4 years ago

sherriff93 commented 4 years ago

To reproduce, set animation to true, and set transitionDuration to something large e.g. 5000. This will create a 5 second pause before the move, which will then also last for 5 seconds.

This looks like a result of some weird behaviour with waitForTransition. I have tried a couple of ways of fixing this but to no avail.

We also cannot just remove the setTimeout functions under the comment // Give piece time to transition. - this fixes the first transition, but prevents transitions on anything afterwards.

I think the transition coords/behaviour should be supplied piece by piece, not to the whole board. Because it is supplied to whole board, it appears the setTimeout code is needed to stop piece transitions being removed on rerender (via waitForTransition being set to false).

Is there a simple way you can think of to get rid of the delay before each piece moves?

willb335 commented 4 years ago

I'm looking into this. My initial impression is this might take a substantial rewrite to getDerivedStateFromProps and componentDidUpdate.

willb335 commented 4 years ago

I'm going to hold off on fixing this. This would take a substantial amount of time, I may have to label this library as unmaintained shortly. I apologize for not being of more help. I hope you can find a way around this issue

sherriff93 commented 4 years ago

Ok no worries, I'll let you know if I get chance to make a PR

On Fri, 1 Nov 2019 at 14:46, Will notifications@github.com wrote:

I'm going to hold off on fixing this. This would take a substantial amount of time, I may have to label this library as unmaintained shortly. I apologize for not being of more help. I hope you can find a way around this issue

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/willb335/chessboardjsx/issues/45?email_source=notifications&email_token=AB5Z2M6GHFCOACKPGJHLC7LQRQXKFA5CNFSM4JGFYQN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC26WBY#issuecomment-548793095, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5Z2M7VXYCPMN4HJONVXEDQRQXKFANCNFSM4JGFYQNQ .