Closed tbazelczuk closed 1 year ago
Under what circumstances does this occur?
It happens when you change position frequently with function setPosition
Unfortunately, I can't reproduce this without an example page where the error occurs.
It happens when you change position during animation.
I would be nice to setPosition without animation and queue, just reset the board with some initial fen
I can not help you, without an example page. This error does not exist in the demo page or any of my usages.
Hi, unfortunately I can't reproduce it. I suspect react setState overhead and async events may cause it.
I prepared example how animation queue works when you mouse over on buttons. When you mouse over very quickly and many time the animation is queued. It would be nice to have reset method and cancel queued animations. https://github.com/tbazelczuk/cm-chessboard/blob/example/examples/preview.html
If you can't reproduce it without react, then the failure seems to be in react. I can not give support for react because I don't use it. 🤷♂️ The animation queue is a core feature of cm-chessboard, it makes no sense to animate the figures without the queue. However you can switch off animations with a parameter of "setPosition".
Sure, but resetting the board without any delay would solve the issue. Even if you turn off animation with setPosition cause the problem with stacking animation because all transitions are still in the queue.
In that case this is a feature quest for a "flush queue" feature?
Right, I think that would solve the issue.
Many thanks :)
Does anyone needs this anymore?
yes :)
Do you need more a "flush queue", "reset queue" or "stop queue" feature? Is the state of the pieces important after resetting?
Does chessboard.positionAnimationsQueue.stop = true
works?
Hi,
I've found two bugs. Please see below description.
TypeError: Cannot read properties of null (reading 'parentNode')
PositionAnimationsQueue.js:145
... and sometimes removeElement has null element