ui-components
ui-components copied to clipboard
[Card deck] Original transform value is fully replaced during animation
Thanks for another cool piece of open-source software!
Description
Changes to the transform
CSS property are made with a simple reassignment without taking care of the previous value. This may cause some unexpected side-effects, one of which can already be observed in the component demo.
Steps to reproduce
- Visit the component's demo page.
- Notice that the top card in the deck is rotated by a random value.
- Simply click on that card.
- It is not rotated any more, because the whole
transform
property was replaced by a new value.
A possible solution
In order to make all the transform
updates change only the corresponding part a special function should be provided and used instead of direct transform
reassignment. Given a set of transform
properties it will either insert or update those in the property value string.
I could try to dig deeper and propose a simple RegExp-based solution if you're interested.
@nscyclone if you want you are welcome to create fix for it ! :)