fix: minor updated the region lasso selection behavior
This commit is contained in:
@@ -94,6 +94,7 @@ const MainContent: React.FC<MainContentProps> = ({
|
||||
|
||||
// Refs to track pending updates for verification
|
||||
const pendingUpdates = useRef<Map<string, { trackId: string, regionId: string, startBeat: number, length: number }>>(new Map());
|
||||
const preventEmptyMainContentDeselectRef = useRef(false);
|
||||
|
||||
// Refs for auto-scroll during playback
|
||||
const mainContentRef = useRef<HTMLDivElement | null>(null);
|
||||
@@ -632,9 +633,18 @@ const MainContent: React.FC<MainContentProps> = ({
|
||||
return;
|
||||
}
|
||||
|
||||
if (preventEmptyMainContentDeselectRef.current) {
|
||||
preventEmptyMainContentDeselectRef.current = false;
|
||||
return;
|
||||
}
|
||||
|
||||
handleRegionLassoSelection([], { shiftKey: false });
|
||||
};
|
||||
|
||||
const handleRegionLassoCommit = () => {
|
||||
preventEmptyMainContentDeselectRef.current = true;
|
||||
};
|
||||
|
||||
// Handle region single click: selection only (no piano roll opening)
|
||||
const handleRegionClick = (regionId: string, options: RegionClickOptions = { shiftKey: false }) => {
|
||||
if (DEBUG_MODE.MAIN_CONTENT) {
|
||||
@@ -990,6 +1000,7 @@ const MainContent: React.FC<MainContentProps> = ({
|
||||
onRegionUpdated={handleRegionUpdated}
|
||||
onRegionClick={handleRegionClick}
|
||||
onRegionLassoSelection={handleRegionLassoSelection}
|
||||
onRegionLassoCommit={handleRegionLassoCommit}
|
||||
onOpenPianoRoll={handleOpenPianoRoll}
|
||||
onOpenSpectrogram={handleOpenSpectrogram}
|
||||
showHybridButtonForAudio={showHybridButtonForAudio}
|
||||
|
||||
Reference in New Issue
Block a user