From 70d5d2967e11e41099e822896cd369ff8d320cc8 Mon Sep 17 00:00:00 2001 From: Robert Daly Date: Tue, 19 Jul 2022 23:13:37 -0400 Subject: [PATCH] adding some logic to update the size of image when cycled --- src/components/AttachmentCarousel.js | 2 +- src/components/ImageView/index.native.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/AttachmentCarousel.js b/src/components/AttachmentCarousel.js index e240323ec854..48e4624967bb 100644 --- a/src/components/AttachmentCarousel.js +++ b/src/components/AttachmentCarousel.js @@ -176,7 +176,7 @@ class AttachmentCarousel extends React.Component { )} canUseTouchScreen() && this.onShowArrow(!this.state.showArrows)} + onPress={() => canUseTouchScreen() && this.onShowArrow(!this.state.showArrows)} onSwipeHorizontal={this.cycleThroughAttachments} > diff --git a/src/components/ImageView/index.native.js b/src/components/ImageView/index.native.js index cf763b7a00fc..543353990682 100644 --- a/src/components/ImageView/index.native.js +++ b/src/components/ImageView/index.native.js @@ -55,6 +55,14 @@ class ImageView extends PureComponent { this.state.interactionPromise = InteractionManager.runAfterInteractions(() => this.calculateImageSize()); } + componentDidUpdate() { + // This resizes the images on cycling + if (!this.state.containerHeight || this.state.isLoading) { + return; + } + this.calculateImageSize(); + } + componentWillUnmount() { if (!this.state.interactionPromise) { return;