diff --git a/src/components/AttachmentCarousel.js b/src/components/AttachmentCarousel.js index 26b721a36f2..590ea5b1d32 100644 --- a/src/components/AttachmentCarousel.js +++ b/src/components/AttachmentCarousel.js @@ -8,6 +8,7 @@ import * as Expensicons from './Icon/Expensicons'; import styles from '../styles/styles'; import themeColors from '../styles/themes/default'; import reportActionPropTypes from '../pages/home/report/reportActionPropTypes'; +import canUseTouchScreen from '../libs/canUseTouchscreen'; import CONFIG from '../CONFIG'; import CONST from '../CONST'; import ONYXKEYS from '../ONYXKEYS'; @@ -70,10 +71,16 @@ class AttachmentCarousel extends React.Component { } componentDidMount() { + if(canUseTouchScreen) { + return + } document.addEventListener('keydown', this.handleArrowPress); } componentWillUnmount() { + if(canUseTouchScreen()) { + return + } document.removeEventListener('keydown', this.handleArrowPress); } diff --git a/src/components/AttachmentModal.js b/src/components/AttachmentModal.js index 9c8fd14587d..b63fedc6926 100755 --- a/src/components/AttachmentModal.js +++ b/src/components/AttachmentModal.js @@ -1,6 +1,6 @@ import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; -import {View} from 'react-native'; +import {Pressable, View} from 'react-native'; import Str from 'expensify-common/lib/str'; import lodashGet from 'lodash/get'; import _ from 'lodash'; @@ -220,8 +220,9 @@ class AttachmentModal extends PureComponent { /> ) : ''} /> - this.onShowArrow(!this.state.showArrows)} onMouseEnter={() => this.onShowArrow(true)} onMouseLeave={() => this.onShowArrow(false)} > @@ -236,7 +237,7 @@ class AttachmentModal extends PureComponent { /> )} - + {/* If we have an onConfirm method show a confirmation button */} {this.props.onConfirm && (