disables keybindings when typing in an input

pull/27/head
EllangoK 2023-02-09 20:40:01 -05:00
parent 74a5dcc03d
commit e13a0bd775
1 changed files with 6 additions and 0 deletions

View File

@ -219,6 +219,12 @@ gradioApp().addEventListener("keydown", function(event) {
return;
}
// If the user is typing in an input field, dont listen for keypresses
let target = event.originalTarget || event.explicitOriginalTarget;
if (target.nodeName === "INPUT" || target.nodeName === "TEXTAREA") {
return;
}
let tabname = image_browser_current_tab();
// Listens for keypresses 0-5 and updates the corresponding ranking (0 is the last option, None)