chessboardjsx icon indicating copy to clipboard operation
chessboardjsx copied to clipboard

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

Open sherriff93 opened this issue 5 years ago • 3 comments

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.

  • waitForTransition cannot just be set to false as it is also used as a truth value for getting transition coordinates - (search for waitfortransition && - This shouldn't be the case, they have different meanings/usages).

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?

sherriff93 avatar Oct 29 '19 09:10 sherriff93

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

willb335 avatar Oct 29 '19 21:10 willb335

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

willb335 avatar Nov 01 '19 13:11 willb335

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 [email protected] 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 .

sherriff93 avatar Nov 01 '19 14:11 sherriff93