Skip to content

Commit

Permalink
fix onPress props being added to non-linked text bug
Browse files Browse the repository at this point in the history
  • Loading branch information
obipawan committed Apr 26, 2018
1 parent 92a2817 commit 4d21bf6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Hyperlink.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,20 @@ class Hyperlink extends Component {
? this.props.linkText(url)
: this.props.linkText

const clickHandlerProps = {}
if (OS !== 'web') {
componentProps.onLongPress = this.props.onLongPress
clickHandlerProps.onLongPress = this.props.onLongPress
? () => this.props.onLongPress(url, text)
: undefined
}
componentProps.onPress = this.props.onPress
clickHandlerProps.onPress = this.props.onPress
? () => this.props.onPress(url, text)
: undefined

elements.push(
<Text
{ ...componentProps }
{ ...clickHandlerProps }
key={ url + index }
style={ [ component.props.style, this.props.linkStyle ] }
>
Expand Down

0 comments on commit 4d21bf6

Please sign in to comment.