From c8192ac48c9e075e12ba7ce2d99590666e45c94b Mon Sep 17 00:00:00 2001 From: Robert Long Date: Tue, 31 Aug 2021 14:44:21 -0700 Subject: [PATCH] Attempt to get drag working on mobile --- src/VideoGrid.jsx | 4 +++- src/VideoGrid.module.css | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/VideoGrid.jsx b/src/VideoGrid.jsx index e69edc0..a49d178 100644 --- a/src/VideoGrid.jsx +++ b/src/VideoGrid.jsx @@ -600,7 +600,9 @@ export function VideoGrid({ participants }) { ); const bind = useDrag( - ({ args: [key], active, xy, movement, tap }) => { + ({ args: [key], active, xy, movement, tap, event }) => { + event.preventDefault(); + if (tap) { onTap(key); return; diff --git a/src/VideoGrid.module.css b/src/VideoGrid.module.css index 69cf53d..f81293c 100644 --- a/src/VideoGrid.module.css +++ b/src/VideoGrid.module.css @@ -28,6 +28,13 @@ limitations under the License. background-color: #444; } +.participantTile * { + touch-action: none; + -moz-user-select: none; + -webkit-user-drag: none; + user-select: none; +} + .participantTile video { width: 100%; height: 100%;