Skip to content

Commit

Permalink
fixed up some mobile issues from the move
Browse files Browse the repository at this point in the history
  • Loading branch information
JediWattson committed Oct 21, 2022
1 parent 799cf6c commit 6b9accf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/AttachmentCarousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class AttachmentCarousel extends React.Component {
canSwipeLeft={!this.state.isBackDisabled}
canSwipeRight={!this.state.isForwardDisabled}
onPress={() => this.canUseTouchScreen && this.onShowArrow(!this.state.showArrows)}
onCycleThroughAttachments={this.cycleThroughAttachments}
onSwipe={this.cycleThroughAttachments}
>
<AttachmentView onPDFPress={() => this.onShowArrow(!this.state.showArrows)} sourceURL={this.state.sourceURL} file={this.state.file} />
</Carousel>
Expand Down
8 changes: 2 additions & 6 deletions src/components/Carousel/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {PanResponder, Dimensions, Animated} from 'react-native';
import PropTypes from 'prop-types';

import styles from '../../styles/styles';
import CONST from '../../CONST';

const propTypes = {
children: PropTypes.element.isRequired,
Expand Down Expand Up @@ -32,12 +31,8 @@ class Carousel extends Component {
this.pan = new Animated.Value(0);

this.panResponder = PanResponder.create({
onMoveShouldSetPanResponderCapture: (_event, gestureState) => {
if (gestureState.dy < CONST.COMPOSER_MAX_HEIGHT) { return; }
return true;
},

onStartShouldSetPanResponder: () => true,

onPanResponderMove: (event, gestureState) => Animated.event([null, {
dx: this.pan,
}], {useNativeDriver: false})(event, gestureState),
Expand All @@ -59,6 +54,7 @@ class Carousel extends Component {
if (!finished) {
return;
}

this.props.onSwipe(deltaSlide);
this.pan.setValue(slideLength);
Animated.timing(this.pan, {useNativeDriver: false, duration: 100, toValue: 0}).start();
Expand Down
1 change: 1 addition & 0 deletions src/components/PDFView/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ class PDFView extends Component {
onError={this.initiatePasswordChallenge}
password={this.state.password}
onLoadComplete={this.finishPdfLoad}
onPageSingleTap={this.props.onPress}
/>
</TouchableWithoutFeedback>
)}
Expand Down

0 comments on commit 6b9accf

Please sign in to comment.