Skip to content

Commit 1e79078

Browse files
stokesbgacooperka
authored andcommitted
Fix janky fullscreen Lightbox images by using flex: 1 (#467)
Setting image to full width/height makes animation returning image to previous spot look extremely awkward. flex: 1 allows image to resize between thumbnail and fullscreen as was intended with lightbox.
1 parent f6c5482 commit 1e79078

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/MessageImage.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default class MessageImage extends React.Component {
1717
<View style={[styles.container, this.props.containerStyle]}>
1818
<Lightbox
1919
activeProps={{
20-
style: [styles.imageActive, { width, height }],
20+
style: styles.imageActive,
2121
}}
2222
{...this.props.lightboxProps}
2323
>
@@ -43,6 +43,7 @@ const styles = StyleSheet.create({
4343
resizeMode: 'cover',
4444
},
4545
imageActive: {
46+
flex: 1,
4647
resizeMode: 'contain',
4748
},
4849
});

0 commit comments

Comments
 (0)