Skip to content

🎥 Make videos programmatically with React

add touchAction: 'none'

Jonny Burger29c1c94ed448
diff --git a/packages/docs/docs/player/drag-and-drop/SelectionOutline.tsx b/packages/docs/docs/player/drag-and-drop/SelectionOutline.tsx
index 9b97ce14ae..2346aa57a5 100644
--- a/packages/docs/docs/player/drag-and-drop/SelectionOutline.tsx
+++ b/packages/docs/docs/player/drag-and-drop/SelectionOutline.tsx
@@ -35,6 +35,7 @@ export const SelectionOutline: React.FC<{
outline:
hovered || isSelected ? `${scaledBorder}px solid #0B84F3` : undefined,
userSelect: 'none',
+ touchAction: 'none',
};
}, [hovered, item, scaledBorder, isSelected]);
diff --git a/packages/docs/docs/player/drag-and-drop/index.mdx b/packages/docs/docs/player/drag-and-drop/index.mdx
index 3b83191b09..a0e7f8c4e6 100644
--- a/packages/docs/docs/player/drag-and-drop/index.mdx
+++ b/packages/docs/docs/player/drag-and-drop/index.mdx
@@ -230,6 +230,7 @@ export const SelectionOutline: React.FC<{
outline:
hovered || isSelected ? `${scaledBorder}px solid #0B84F3` : undefined,
userSelect: 'none',
+ touchAction: 'none',
};
}, [hovered, item, scaledBorder, isSelected]);
@@ -549,6 +550,10 @@ Later, we will treat any event that bubbles up as an click on an empty space and
We also don't do any action if `e.button !== 0`. This prevents a bug where the item moves after a right click.
+We add `userSelect: 'none'` to disable the native selection and drag behavior of the browser.
+
+We also add `touchAction: 'none` to disable scrolling the page on mobile while dragging.
+
### <TitleStep>4</TitleStep> Sorting outlines
Let's create a component that renders all outlines.