Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

fix(export): clear timeline selection when opening export panel

auberginewly37eaacc07b56
diff --git a/src/components/video-editor/SettingsPanel.tsx b/src/components/video-editor/SettingsPanel.tsx
index d36839763..ef597d22f 100644
--- a/src/components/video-editor/SettingsPanel.tsx
+++ b/src/components/video-editor/SettingsPanel.tsx
@@ -284,6 +284,7 @@ interface SettingsPanelProps {
onGifSizePresetChange?: (preset: GifSizePreset) => void;
gifOutputDimensions?: { width: number; height: number };
onExport?: () => void;
+ onExportPanelOpen?: () => void;
unsavedExport?: {
arrayBuffer: ArrayBuffer;
fileName: string;
@@ -414,6 +415,7 @@ export function SettingsPanel({
onGifSizePresetChange,
gifOutputDimensions = DEFAULT_GIF_SETTINGS.outputDimensions,
onExport,
+ onExportPanelOpen,
unsavedExport,
onSaveUnsavedExport,
selectedAnnotationId,
@@ -822,7 +824,10 @@ export function SettingsPanel({
data-testid={getTestId("export-panel-button")}
type="button"
title={exportPanelMode.label}
- onClick={() => setActivePanelMode(exportPanelMode.id)}
+ onClick={() => {
+ setActivePanelMode(exportPanelMode.id);
+ onExportPanelOpen?.();
+ }}
className={cn(
"mt-auto flex h-8 w-8 items-center justify-center rounded-lg border transition-all",
activePanelMode === "export" && !hasTimelineSelection
diff --git a/src/components/video-editor/VideoEditor.tsx b/src/components/video-editor/VideoEditor.tsx
index b32621c96..bbd043a95 100644
--- a/src/components/video-editor/VideoEditor.tsx
+++ b/src/components/video-editor/VideoEditor.tsx
@@ -2256,6 +2256,11 @@ export default function VideoEditor() {
: getAspectRatioValue(aspectRatio),
)}
onExport={handleOpenExportDialog}
+ onExportPanelOpen={() => {
+ setSelectedZoomId(null);
+ setSelectedTrimId(null);
+ setSelectedSpeedId(null);
+ }}
selectedAnnotationId={selectedAnnotationId}
annotationRegions={annotationOnlyRegions}
onAnnotationContentChange={handleAnnotationContentChange}