fix: random not able to exit piano roll hybrid mode issue when switching between different MIDI regions (introduced a region dragging start threshold)

This commit is contained in:
Xiaohan-Tian
2026-05-01 20:34:21 -07:00
parent cbd2fc60a0
commit d5795c5281
6 changed files with 234 additions and 36 deletions
+8 -1
View File
@@ -492,6 +492,13 @@ const TrackGridItem: React.FC<TrackGridItemProps> = ({
currentDragTop.current = null;
currentDragRegion.current = null;
if (finalBarNumber === region.barNumber && finalTrackIndex === region.trackIndex) {
if (DEBUG_MODE.TRACK_GRID_ITEM) {
console.log(`Skipping no-op drag update for region ${regionId}`);
}
return;
}
// Notify parent about drag end with final values
if (onRegionDragEnd) {
onRegionDragEnd(regionId, finalBarNumber, finalTrackIndex);
@@ -589,4 +596,4 @@ const TrackGridItem: React.FC<TrackGridItemProps> = ({
);
};
export default TrackGridItem;
export default TrackGridItem;