Skip to content

Commit 3f2de5c

Browse files
authored
Merge pull request #30901 from software-mansion-labs/fix-lottie-height
Fix Lottie animations height when not playing
2 parents ca79bae + f5adef9 commit 3f2de5c

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

ios/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ PODS:
234234
- libwebp/demux
235235
- libwebp/webp (1.2.4)
236236
- lottie-ios (4.3.3)
237-
- lottie-react-native (6.3.1):
238-
- lottie-ios (~> 4.3.0)
237+
- lottie-react-native (6.4.0):
238+
- lottie-ios (~> 4.3.3)
239239
- React-Core
240240
- MapboxCommon (23.6.0)
241241
- MapboxCoreMaps (10.14.0):
@@ -1203,7 +1203,7 @@ SPEC CHECKSUMS:
12031203
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
12041204
libwebp: f62cb61d0a484ba548448a4bd52aabf150ff6eef
12051205
lottie-ios: 25e7b2675dad5c3ddad369ac9baab03560c5bfdd
1206-
lottie-react-native: c9f1db4f4124dcce9f8159e65d8dc6e8bcb11fb4
1206+
lottie-react-native: 3a3084faddd3891c276f23fd6e797b83f2021bbc
12071207
MapboxCommon: 4a0251dd470ee37e7fadda8e285c01921a5e1eb0
12081208
MapboxCoreMaps: eb07203bbb0b1509395db5ab89cd3ad6c2e3c04c
12091209
MapboxMaps: af50ec61a7eb3b032c3f7962c6bd671d93d2a209

src/components/Lottie/Lottie.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
import LottieView, {LottieViewProps} from 'lottie-react-native';
22
import React, {forwardRef} from 'react';
3+
import {View} from 'react-native';
34
import styles from '@styles/styles';
45

56
const Lottie = forwardRef<LottieView, LottieViewProps>((props: LottieViewProps, ref) => {
67
const aspectRatioStyle = styles.aspectRatioLottie(props.source);
78

89
return (
9-
<LottieView
10-
// eslint-disable-next-line
11-
{...props}
12-
ref={ref}
13-
style={[aspectRatioStyle, props.style]}
14-
webStyle={{...aspectRatioStyle, ...props.webStyle}}
15-
/>
10+
<View style={[aspectRatioStyle, styles.w100]}>
11+
<LottieView
12+
// eslint-disable-next-line
13+
{...props}
14+
ref={ref}
15+
style={[aspectRatioStyle, props.style]}
16+
webStyle={{...aspectRatioStyle, ...props.webStyle}}
17+
/>
18+
</View>
1619
);
1720
});
1821

0 commit comments

Comments
 (0)