From 9a8f59b1d33ec78e1ea93ab6df33bf4085fa1d25 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 6 Dec 2023 15:26:12 -1000 Subject: [PATCH 1/3] Fix deep linking --- .../HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js b/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js index 8f1406439be9..0c36bc36c11e 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js +++ b/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js @@ -62,7 +62,7 @@ function AnchorRenderer(props) { key={props.key} displayName={displayName} // Only pass the press handler for internal links. For public links or whitelisted internal links fallback to default link handling - onPress={internalNewExpensifyPath || internalExpensifyPath ? Link.openLink : undefined} + onPress={() => internalNewExpensifyPath || internalExpensifyPath ? Link.openLink(attrHref, environmentURL, isAttachment) : undefined} > From 1e8bb05c0b886da4ff2c6baca612eeb846f739f6 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 6 Dec 2023 15:27:18 -1000 Subject: [PATCH 2/3] Pass undefined to onPress --- .../HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js b/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js index 0c36bc36c11e..2216f88d1055 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js +++ b/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js @@ -61,8 +61,9 @@ function AnchorRenderer(props) { style={{...props.style, ...parentStyle, ...styles.textUnderlinePositionUnder, ...styles.textDecorationSkipInkNone}} key={props.key} displayName={displayName} + // Only pass the press handler for internal links. For public links or whitelisted internal links fallback to default link handling - onPress={() => internalNewExpensifyPath || internalExpensifyPath ? Link.openLink(attrHref, environmentURL, isAttachment) : undefined} + onPress={(internalNewExpensifyPath || internalExpensifyPath) ? () => Link.openLink(attrHref, environmentURL, isAttachment) : undefined} > From c9df3705ed7af717c80b264cc3dbb5bf2aec8ce9 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 6 Dec 2023 15:34:16 -1000 Subject: [PATCH 3/3] Fix prettier --- .../HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js b/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js index 2216f88d1055..49642308a357 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js +++ b/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js @@ -61,9 +61,8 @@ function AnchorRenderer(props) { style={{...props.style, ...parentStyle, ...styles.textUnderlinePositionUnder, ...styles.textDecorationSkipInkNone}} key={props.key} displayName={displayName} - // Only pass the press handler for internal links. For public links or whitelisted internal links fallback to default link handling - onPress={(internalNewExpensifyPath || internalExpensifyPath) ? () => Link.openLink(attrHref, environmentURL, isAttachment) : undefined} + onPress={internalNewExpensifyPath || internalExpensifyPath ? () => Link.openLink(attrHref, environmentURL, isAttachment) : undefined} >