fix: ensure dragging/resizing an element on the timeline doesn't deselect it

This commit is contained in:
Maze Winther
2025-07-19 16:19:06 +02:00
parent 0d95f032cc
commit 42ae8a7530
3 changed files with 69 additions and 34 deletions
-8
View File
@@ -74,7 +74,6 @@ interface TimelineStore {
clickOffsetTime: number;
currentTime: number;
};
justFinishedDragging: boolean;
setDragState: (dragState: Partial<TimelineStore["dragState"]>) => void;
startDrag: (
elementId: string,
@@ -231,8 +230,6 @@ export const useTimelineStore = create<TimelineStore>((set, get) => {
// Snapping settings defaults
snappingEnabled: true,
justFinishedDragging: false,
getSortedTracks: () => {
const { _tracks } = get();
const tracksWithMain = ensureMainTrack(_tracks);
@@ -941,12 +938,7 @@ export const useTimelineStore = create<TimelineStore>((set, get) => {
clickOffsetTime: 0,
currentTime: 0,
},
justFinishedDragging: true,
});
setTimeout(() => {
set({ justFinishedDragging: false });
}, 50);
},
// Persistence methods