diff --git a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js index c673677b73f2..4683d9534e7a 100644 --- a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js +++ b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js @@ -10,6 +10,8 @@ import * as ReportActionContextMenu from '../../../pages/home/report/ContextMenu import * as ContextMenuActions from '../../../pages/home/report/ContextMenu/ContextMenuActions'; import AttachmentView from '../../AttachmentView'; import fileDownload from '../../../libs/fileDownload'; +import canUseTouchScreen from '../../../libs/canUseTouchscreen'; +import styles from '../../../styles/styles'; /* * This is a default anchor component for regular links. @@ -38,6 +40,8 @@ class BaseAnchorForCommentsOnly extends React.Component { render() { let linkRef; const rest = _.omit(this.props, _.keys(propTypes)); + const defaultTextStyle = canUseTouchScreen() || this.props.isSmallScreenWidth ? {} : styles.userSelectText; + return ( this.props.isAttachment ? ( @@ -72,7 +76,7 @@ class BaseAnchorForCommentsOnly extends React.Component { > linkRef = el} - style={StyleSheet.flatten(this.props.style)} + style={StyleSheet.flatten([this.props.style, defaultTextStyle])} accessibilityRole="link" href={this.props.href} hrefAttrs={{ diff --git a/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js b/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js index 37a9f693cf2f..a7e4c910f938 100755 --- a/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js +++ b/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js @@ -36,7 +36,7 @@ const customHTMLElementModels = { }), }; -const defaultViewProps = {style: {alignItems: 'flex-start'}}; +const defaultViewProps = {style: [styles.alignItemsStart, styles.userSelectText]}; // We are using the explicit composite architecture for performance gains. // Configuration for RenderHTML is handled in a top-level component providing diff --git a/src/styles/styles.js b/src/styles/styles.js index 730a98495aee..ed1154e998b3 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -2491,6 +2491,10 @@ const styles = { closeAccountMessageInput: { height: 153, }, + + userSelectText: { + userSelect: 'text', + }, }; export default styles;