From 84fc9c26897bd6becf9cbef515e966931876316d Mon Sep 17 00:00:00 2001 From: tienifr Date: Wed, 21 Feb 2024 02:51:11 +0700 Subject: [PATCH] fix: long press video toggles text selection --- src/components/VideoPlayerPreview/VideoPlayerThumbnail.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/VideoPlayerPreview/VideoPlayerThumbnail.js b/src/components/VideoPlayerPreview/VideoPlayerThumbnail.js index b31da89118a8..595442c317d5 100644 --- a/src/components/VideoPlayerPreview/VideoPlayerThumbnail.js +++ b/src/components/VideoPlayerPreview/VideoPlayerThumbnail.js @@ -7,6 +7,8 @@ import Image from '@components/Image'; import PressableWithoutFeedback from '@components/Pressable/PressableWithoutFeedback'; import {ShowContextMenuContext, showContextMenuForReport} from '@components/ShowContextMenuContext'; import useThemeStyles from '@hooks/useThemeStyles'; +import ControlSelection from '@libs/ControlSelection'; +import * as DeviceCapabilities from '@libs/DeviceCapabilities'; import * as ReportUtils from '@libs/ReportUtils'; import variables from '@styles/variables'; import CONST from '@src/CONST'; @@ -44,6 +46,8 @@ function VideoPlayerThumbnail({thumbnailUrl, onPress, accessibilityLabel}) { accessibilityLabel={accessibilityLabel} accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON} onPress={onPress} + onPressIn={() => DeviceCapabilities.canUseTouchScreen() && ControlSelection.block()} + onPressOut={() => ControlSelection.unblock()} onLongPress={(event) => showContextMenuForReport(event, anchor, (report && report.reportID) || '', action, checkIfContextMenuActive, ReportUtils.isArchivedRoom(report)) }