diff --git a/src/components/hyper-ref/hyper-ref.tsx b/src/components/hyper-ref/hyper-ref.tsx index ae7c186e9..0f97727c8 100644 --- a/src/components/hyper-ref/hyper-ref.tsx +++ b/src/components/hyper-ref/hyper-ref.tsx @@ -297,6 +297,22 @@ export default class HyperRef extends PureComponent { const style = this.getStyle(); const { accessibilityLabel, testID } = createTestProps(this.props.element); const { onLongPress, onPress, onPressIn, onPressOut } = pressHandlers; + const elementHasAction = !!this.props.element.getAttribute('action'); + const elementHasHref = !!this.props.element.getAttribute('href'); + const hasActionablePressBehavior = behaviors.some(behaviorElement => { + const behaviorAction = ( + behaviorElement.getAttribute(BEHAVIOR_ATTRIBUTES.ACTION) || '' + ).toLowerCase(); + const behaviorHref = behaviorElement.getAttribute( + BEHAVIOR_ATTRIBUTES.HREF, + ); + return ( + (behaviorAction !== '' && behaviorAction !== 'amplitude') || + !!behaviorHref + ); + }); + const disabled = + !elementHasAction && !elementHasHref && !hasActionablePressBehavior; // If element is a nested under another , simply add press events const isNestedUnderText = @@ -310,22 +326,25 @@ export default class HyperRef extends PureComponent { return ( { return (