mirror of
https://github.com/zhigang1992/react-native-gifted-chat.git
synced 2026-04-28 20:25:43 +08:00
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.
This commit is contained in:
committed by
Kevin Cooper
parent
f6c54825a3
commit
1e79078265
@@ -17,7 +17,7 @@ export default class MessageImage extends React.Component {
|
||||
<View style={[styles.container, this.props.containerStyle]}>
|
||||
<Lightbox
|
||||
activeProps={{
|
||||
style: [styles.imageActive, { width, height }],
|
||||
style: styles.imageActive,
|
||||
}}
|
||||
{...this.props.lightboxProps}
|
||||
>
|
||||
@@ -43,6 +43,7 @@ const styles = StyleSheet.create({
|
||||
resizeMode: 'cover',
|
||||
},
|
||||
imageActive: {
|
||||
flex: 1,
|
||||
resizeMode: 'contain',
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user