From 4b5b1e79bf3e55c358bfbe8b7583735f32685211 Mon Sep 17 00:00:00 2001 From: s-alves10 Date: Tue, 22 Aug 2023 08:57:46 -0500 Subject: [PATCH 1/2] fix: imitate the web event for native image renderer --- .../HTMLEngineProvider/HTMLRenderers/ImageRenderer.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.js b/src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.js index 2f4ee7780346..c263af7ae26c 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.js +++ b/src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.js @@ -64,7 +64,15 @@ function ImageRenderer(props) { const route = ROUTES.getReportAttachmentRoute(report.reportID, source); Navigation.navigate(route); }} - onLongPress={(event) => showContextMenuForReport(event, anchor, report.reportID, action, checkIfContextMenuActive, ReportUtils.isArchivedRoom(report))} + onLongPress={(event) => showContextMenuForReport( + // Imitate the web event for native renderers + {nativeEvent: {...(event.nativeEvent || {}), target: {tagName: 'IMG'}}}, + anchor, + report.reportID, + action, + checkIfContextMenuActive, + ReportUtils.isArchivedRoom(report) + )} accessibilityRole={CONST.ACCESSIBILITY_ROLE.IMAGEBUTTON} accessibilityLabel={props.translate('accessibilityHints.viewAttachment')} > From d7d3d876ab018d1d8ae8b5635b5d1c37b1e10e35 Mon Sep 17 00:00:00 2001 From: s-alves10 Date: Tue, 22 Aug 2023 08:59:49 -0500 Subject: [PATCH 2/2] fix: prettier --- .../HTMLRenderers/ImageRenderer.js | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.js b/src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.js index c263af7ae26c..9c6116620be2 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.js +++ b/src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.js @@ -64,15 +64,17 @@ function ImageRenderer(props) { const route = ROUTES.getReportAttachmentRoute(report.reportID, source); Navigation.navigate(route); }} - onLongPress={(event) => showContextMenuForReport( - // Imitate the web event for native renderers - {nativeEvent: {...(event.nativeEvent || {}), target: {tagName: 'IMG'}}}, - anchor, - report.reportID, - action, - checkIfContextMenuActive, - ReportUtils.isArchivedRoom(report) - )} + onLongPress={(event) => + showContextMenuForReport( + // Imitate the web event for native renderers + {nativeEvent: {...(event.nativeEvent || {}), target: {tagName: 'IMG'}}}, + anchor, + report.reportID, + action, + checkIfContextMenuActive, + ReportUtils.isArchivedRoom(report), + ) + } accessibilityRole={CONST.ACCESSIBILITY_ROLE.IMAGEBUTTON} accessibilityLabel={props.translate('accessibilityHints.viewAttachment')} >