Fix pitch input: stop editor keydown handler from intercepting input fields

The edKeyDown handler was catching Backspace, Delete, arrow keys, and other
keys globally, even when the user was typing in the pitch input field. This
made it impossible to edit the pitch value (e.g. changing D4 to A4) because
Backspace would delete the selected note instead of editing the text.

Added a check to skip the handler when focus is on INPUT, TEXTAREA, or SELECT.

https://claude.ai/code/session_01TLvDyKzUQekd9hzFuEJ5YX
This commit is contained in:
Claude
2026-04-02 16:10:58 +00:00
parent 9920816ef7
commit 07b6b9a868
+3
View File
@@ -5547,6 +5547,9 @@ function edWheel(e){
}
function edKeyDown(e){
if(!document.getElementById("sed").classList.contains("active"))return;
// Don't intercept keys when user is typing in an input or select (e.g. pitch input)
var tag=document.activeElement&&document.activeElement.tagName;
if(tag==="INPUT"||tag==="TEXTAREA"||tag==="SELECT")return;
// Ctrl+C — copy selected range or selected note
if((e.ctrlKey||e.metaKey)&&e.key==="c"){