-
-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transform animation parser fails with eg. transform: 'scale(2,2)' #738
Comments
Ok the STYLE_TRANSFORMATION_MAP explains why something like transform: "translateX(100px) translateY(100px)" only translates the y, as only using "translateX" or "translateY" defaults the other to 0. So here as well I would need "translate(100px, 100px)", but that same parsing issue butchers the expression at the comma. So fixing that pretty much makes it all work, then one just needs to use the double value syntax. |
There's something else seriously wrong. I prototyped a fix which handles each subsequent transform value in a way that it combines already applied values with the new one, which essentially fixes the original issues. So I can write like: transform: "scaleX(2) scaleY(3) translateX(100px) translateY(200px)" and it works. BUT any initially applied transform causes the element to disappear. I can't attach the debugger in time, so I don't know what happens. If I put there another element I can use to trigger a state change, it will reveal the element, it will animate, and I can make it go back and forth between the states. The code example can be found in this post. Here's the code that makes my syntax workI hacked the "nativescript-angular/nativescript-angular/animations/utils.ts", typed directly in the built code - it's not typescript, but JavaScript. Simple to spot the changes though - what I did was that if the "parseTransformation" reduce argument "transformation.property" already is a "base" version of the property being applied (eg. "transition" and "transitionX"), it will detect it and get the "mirror" value already applied, if applied. So when it applies "transitionX", it passes in "y" value if it was found set already.
You gotta try this example to see my pointIf you remove the ":enter" transition, the element is invisible. Click the debug button to trigger the first transition, and you get to toggle it normally. Note: the ":enter" is empty, to demonstrate the bare minimum required to keep the element visible. In any case, the "inactive" state is not applied initially. Here's the example case:
|
regarding:
@skycaptainskycaptain we greatly appreciate all PRs made from our community members :) Ping @sis0k0 , @vakrilov , @PanayotCankov |
Is there any example related to flip-flop animation in nativescript like below link |
I posted about this accidentally to nativescript main issue board; since I have zeroed in on the root cause of why certain animations cause the element to disappear.
Here's the original issue I posted with isolated component example for verifying the issue and all other details:
NativeScript/NativeScript#3937
In the comments you can see what I found out to be the cause.
The text was updated successfully, but these errors were encountered: