Merge pull request #39 from outis1one/clDemoe/fix-pitch-editing-kH3FR
Fix pitch input being overwritten while user is typing
This commit is contained in:
+13
-6
@@ -4998,14 +4998,21 @@ function edUpdateNotePanel(){
|
|||||||
}
|
}
|
||||||
panel.style.display="block";
|
panel.style.display="block";
|
||||||
var m=edMelody[edSelected];
|
var m=edMelody[edSelected];
|
||||||
// Pitch input
|
// Pitch input — skip overwrite when user is actively typing in it
|
||||||
var pitchInput=document.getElementById("ed-note-pitch");
|
var pitchInput=document.getElementById("ed-note-pitch");
|
||||||
pitchInput.value=m.f?edFreqToNote(m.f):"";
|
if(document.activeElement!==pitchInput){
|
||||||
// Duration dropdown
|
pitchInput.value=m.f?edFreqToNote(m.f):"";
|
||||||
|
}
|
||||||
|
// Duration dropdown — skip if focused
|
||||||
var durSel=document.getElementById("ed-note-dur");
|
var durSel=document.getElementById("ed-note-dur");
|
||||||
durSel.value=edDurSecToName(m.d||0);
|
if(document.activeElement!==durSel){
|
||||||
// Lane dropdown
|
durSel.value=edDurSecToName(m.d||0);
|
||||||
document.getElementById("ed-note-lane").value=m.l;
|
}
|
||||||
|
// Lane dropdown — skip if focused
|
||||||
|
var laneEl=document.getElementById("ed-note-lane");
|
||||||
|
if(document.activeElement!==laneEl){
|
||||||
|
laneEl.value=m.l;
|
||||||
|
}
|
||||||
// Info line
|
// Info line
|
||||||
var info="t="+m.t.toFixed(3)+"s";
|
var info="t="+m.t.toFixed(3)+"s";
|
||||||
if(m.f)info+=" | freq="+m.f.toFixed(1)+"Hz";
|
if(m.f)info+=" | freq="+m.f.toFixed(1)+"Hz";
|
||||||
|
|||||||
Reference in New Issue
Block a user