Skip to content

Commit

Permalink
Merge pull request Expensify#23526 from bernhardoj/fix/22362-link-inline
Browse files Browse the repository at this point in the history
Fix text next to multiline link shows at the first line of the link instead of the last
  • Loading branch information
techievivek authored Jul 27, 2023
2 parents 24b0ea2 + 4f02074 commit f8bc305
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/PressableWithSecondaryInteraction/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@ class PressableWithSecondaryInteraction extends Component {

render() {
const defaultPressableProps = _.omit(this.props, ['onSecondaryInteraction', 'children', 'onLongPress']);
const inlineStyle = this.props.inline ? styles.dInline : {};

// On Web, Text does not support LongPress events thus manage inline mode with styling instead of using Text.
return (
<PressableWithFeedback
wrapperStyle={StyleUtils.combineStyles(DeviceCapabilities.canUseTouchScreen() ? [styles.userSelectNone, styles.noSelect] : [])}
wrapperStyle={StyleUtils.combineStyles(DeviceCapabilities.canUseTouchScreen() ? [styles.userSelectNone, styles.noSelect] : [], inlineStyle)}
onPressIn={this.props.onPressIn}
onLongPress={this.props.onSecondaryInteraction ? this.executeSecondaryInteraction : undefined}
pressDimmingValue={this.props.activeOpacity}
Expand All @@ -86,7 +87,7 @@ class PressableWithSecondaryInteraction extends Component {
ref={(el) => (this.pressableRef = el)}
// eslint-disable-next-line react/jsx-props-no-spreading
{...defaultPressableProps}
style={(state) => [StyleUtils.parseStyleFromFunction(this.props.style, state), ...[this.props.inline && styles.dInline]]}
style={(state) => [StyleUtils.parseStyleFromFunction(this.props.style, state), inlineStyle]}
>
{this.props.children}
</PressableWithFeedback>
Expand Down

0 comments on commit f8bc305

Please sign in to comment.