hotfix:fixed-cmd-for-deselection

This commit is contained in:
aashishparuvada
2025-06-23 22:49:56 +05:30
parent fddbecc736
commit d605cd762c

View File

@ -1409,9 +1409,18 @@ function TimelineTrackContent({
style={{ width: `${clipWidth}px`, left: `${clipLeft}px` }} style={{ width: `${clipWidth}px`, left: `${clipLeft}px` }}
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
const isSelected = selectedClips.some(
(c) => c.trackId === track.id && c.clipId === clip.id
);
if (e.metaKey || e.ctrlKey || e.shiftKey) { if (e.metaKey || e.ctrlKey || e.shiftKey) {
// Multi-selection mode: toggle the clip
selectClip(track.id, clip.id, true); selectClip(track.id, clip.id, true);
} else if (isSelected) {
// If clip is already selected, deselect it
deselectClip(track.id, clip.id);
} else { } else {
// If clip is not selected, select it (replacing other selections)
selectClip(track.id, clip.id, false); selectClip(track.id, clip.id, false);
} }
}} }}