summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2025-07-26 12:34:57 +0200
committerMaze Winther <mazewinther@gmail.com>2025-07-26 12:34:57 +0200
commit043bf7d70abb705059bed5c0dbcc8007448750ec (patch)
tree5059c2b968e55e39ed324a42dae3edf6f4df6d60 /apps
parent317ee9141ed7cb04128600344ca751a42f780817 (diff)
downloadopencut-043bf7d70abb705059bed5c0dbcc8007448750ec.tar.gz
fix: ensure clicking context menu item doesn't move timeline playhead
Diffstat (limited to 'apps')
-rw-r--r--apps/web/src/components/editor/timeline/index.tsx7
-rw-r--r--apps/web/src/components/editor/timeline/timeline-element.tsx12
2 files changed, 13 insertions, 6 deletions
diff --git a/apps/web/src/components/editor/timeline/index.tsx b/apps/web/src/components/editor/timeline/index.tsx
index 0368e452..bcaece89 100644
--- a/apps/web/src/components/editor/timeline/index.tsx
+++ b/apps/web/src/components/editor/timeline/index.tsx
@@ -746,11 +746,14 @@ export function Timeline() {
</ContextMenuTrigger>
<ContextMenuContent className="z-[200]">
<ContextMenuItem
- onClick={() => toggleTrackMute(track.id)}
+ onClick={(e) => {
+ e.stopPropagation();
+ toggleTrackMute(track.id);
+ }}
>
{track.muted ? "Unmute Track" : "Mute Track"}
</ContextMenuItem>
- <ContextMenuItem>
+ <ContextMenuItem onClick={(e) => e.stopPropagation()}>
Track settings (soon)
</ContextMenuItem>
</ContextMenuContent>
diff --git a/apps/web/src/components/editor/timeline/timeline-element.tsx b/apps/web/src/components/editor/timeline/timeline-element.tsx
index fc40bb54..c66e9fcb 100644
--- a/apps/web/src/components/editor/timeline/timeline-element.tsx
+++ b/apps/web/src/components/editor/timeline/timeline-element.tsx
@@ -102,7 +102,8 @@ export function TimelineElement({
// Element should always be positioned at startTime - trimStart only affects content, not position
const elementLeft = elementStartTime * 50 * zoomLevel;
- const handleElementSplitContext = () => {
+ const handleElementSplitContext = (e: React.MouseEvent) => {
+ e.stopPropagation();
const effectiveStart = element.startTime;
const effectiveEnd =
element.startTime +
@@ -118,7 +119,8 @@ export function TimelineElement({
}
};
- const handleElementDuplicateContext = () => {
+ const handleElementDuplicateContext = (e: React.MouseEvent) => {
+ e.stopPropagation();
const { id, ...elementWithoutId } = element;
addElementToTrack(track.id, {
...elementWithoutId,
@@ -130,7 +132,8 @@ export function TimelineElement({
});
};
- const handleElementDeleteContext = () => {
+ const handleElementDeleteContext = (e: React.MouseEvent) => {
+ e.stopPropagation();
if (rippleEditingEnabled) {
removeElementFromTrackWithRipple(track.id, element.id);
} else {
@@ -138,7 +141,8 @@ export function TimelineElement({
}
};
- const handleReplaceClip = () => {
+ const handleReplaceClip = (e: React.MouseEvent) => {
+ e.stopPropagation();
if (element.type !== "media") {
toast.error("Replace is only available for media clips");
return;