fix: right-click delete note no longer shows context menu

Set rightClickDragRef.erasedNote=true on delete. handleContextMenu
checks and skips menu when true.
This commit is contained in:
2026-07-25 12:30:08 +07:00
parent 7174773cb3
commit 0a17cc91ea
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -4922,6 +4922,7 @@ const PianoRollTabEditor = ({ st, zoom, bpm, viewportWidth, onClose, onUpdateNot
pushToUndo(notes);
setNotes(prev => prev.filter(n => n.id !== clickedNote.id));
setSelectedNoteIds(prev => prev.filter(id => id !== clickedNote.id));
rightClickDragRef.current.erasedNote = true;
showToast('Đã xóa nốt!', 'info');
} else {
rightClickDragRef.current = { active: true, startX: e.clientX, startY: e.clientY };
@@ -5251,6 +5252,10 @@ const PianoRollTabEditor = ({ st, zoom, bpm, viewportWidth, onClose, onUpdateNot
const handleContextMenu = (e) => {
e.preventDefault();
if (rightClickDragRef.current.erasedNote) {
rightClickDragRef.current.erasedNote = false;
return;
}
const pos = { x: e.clientX, y: e.clientY, parentKey: null };
scaleMenuOriginRef.current = { x: pos.x, y: pos.y };
setScaleMenuPos(pos);