From 8e55e85b3eb44147d8bc84d5f02e112d8a6b6b14 Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 21 Apr 2023 15:42:48 +0700 Subject: [PATCH] fix: hide context menu on long press on web --- src/components/ShowContextMenuContext.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/ShowContextMenuContext.js b/src/components/ShowContextMenuContext.js index d063d8ff1eb7..ba123bb984ee 100644 --- a/src/components/ShowContextMenuContext.js +++ b/src/components/ShowContextMenuContext.js @@ -1,6 +1,7 @@ import React from 'react'; import * as ReportActionContextMenu from '../pages/home/report/ContextMenu/ReportActionContextMenu'; import * as ContextMenuActions from '../pages/home/report/ContextMenu/ContextMenuActions'; +import * as DeviceCapabilities from '../libs/DeviceCapabilities'; const ShowContextMenuContext = React.createContext({ anchor: null, @@ -21,6 +22,10 @@ ShowContextMenuContext.displayName = 'ShowContextMenuContext'; * @param {Function} checkIfContextMenuActive Callback to update context menu active state */ function showContextMenuForReport(event, anchor, reportID, action, checkIfContextMenuActive) { + if (!DeviceCapabilities.canUseTouchScreen()) { + return; + } + ReportActionContextMenu.showContextMenu( ContextMenuActions.CONTEXT_MENU_TYPES.REPORT_ACTION, event,