Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(editor): clamp keyboard segments at trim boundary

Minitcd04decae42e
diff --git a/apps/desktop/src/routes/editor/Timeline/KeyboardTrack.tsx b/apps/desktop/src/routes/editor/Timeline/KeyboardTrack.tsx
index b61b02ecc..3b1d44c5f 100644
--- a/apps/desktop/src/routes/editor/Timeline/KeyboardTrack.tsx
+++ b/apps/desktop/src/routes/editor/Timeline/KeyboardTrack.tsx
@@ -165,7 +165,7 @@ export function KeyboardTrack(props: {
isSelected() ? "border-sky-7" : "border-transparent",
)}
innerClass="ring-sky-6"
- segment={segment}
+ segment={{ start: segment.start, end: Math.min(segment.end, totalDuration()) }}
onMouseDown={(e) => {
e.stopPropagation();
if (editorState.timeline.interactMode === "split") {