Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/animated/src/AnimatedArray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class AnimatedArray<
const payload = this.getPayload()
// Reuse the payload when lengths are equal.
if (source.length == payload.length) {
return payload.some((node, i) => node.setValue(source[i]))
return payload.map((node, i) => node.setValue(source[i])).some(Boolean)
}
// Remake the payload when length changes.
super.setValue(source.map(makeAnimated))
Expand Down
11 changes: 11 additions & 0 deletions targets/web/src/animated.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,17 @@ describe('animated component', () => {
'scale(2) translate(10px,20px) translate3d(30px,40px,50px)'
)
})
it('updates all values of Animated arrays', () => {
const translate3d = spring([10, 20, 30] as const)
const { queryByTestId } = render(
<a.div style={{ translate3d }} data-testid="wrapper" />
)
const wrapper: any = queryByTestId('wrapper')!
expect(wrapper.style.transform).toBe('translate3d(10px,20px,30px)')
translate3d.set([11, 21, 31] as const)
mockRaf.step()
expect(wrapper.style.transform).toBe('translate3d(11px,21px,31px)')
})
it('sets default units to unit-less values passed as transform functions', () => {
const { queryByTestId } = render(
<a.div
Expand Down