You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the web platform, when adding the animation prop to a component, the testID prop is removed. It appears to specifically be an issue if using @tamagui/animations-moti for animations. Testing with @tamagui/animations-css package, it worked as expected.
Expected Behavior
The testID prop should remain on the rendered component on web.
Tamagui Version
1.86.6
Platform (Web, iOS, Android)
Web
Reproduction
<StacktestID="testID"animation="quick">
Hello world
</Stack>
The text was updated successfully, but these errors were encountered:
smrubin
changed the title
Using animation prop removes testID prop on web platform
Using animation prop removes testID prop on web platform when using @tamagui/animations-moti
May 3, 2024
Looking at the animations-moti code, it is hard to see anything that could indicate a bug or gap in that package.
So perhaps this is an issue in that package's core dependency, moti. Maybe within moti, the testID is being overwritten/removed unintentionally, or perhaps it needs to be explicitly passed to an inner element?
@nandorojo, what would be your guess? Or your recommendation for how to handle this issue?
Moti definitely isn't involved with that prop. My guess is that this happens since tamagui gets raw props from the component, passes them to moti, gets the style back, but then isn't spreading the test id onto the component it's wrapping
I've attempted a fix for this, we basically have to create our own custom reanimated underling view rather than using their View, and then make it support applying the various web-only tamagui features. It's very doable but when I tried last I ran into various issues. cc @ehxxn
Current Behavior
On the web platform, when adding the animation prop to a component, the testID prop is removed. It appears to specifically be an issue if using
@tamagui/animations-moti
for animations. Testing with@tamagui/animations-css
package, it worked as expected.Expected Behavior
The testID prop should remain on the rendered component on web.
Tamagui Version
Platform (Web, iOS, Android)
Reproduction
The text was updated successfully, but these errors were encountered: