Fix quicksettings dropdown changes not being detected

Fixes #176
This commit is contained in:
DominikDoom
2023-05-09 14:42:32 +02:00
parent c1d610e390
commit cc67adf82f
2 changed files with 30 additions and 1 deletions

View File

@@ -855,7 +855,7 @@ async function setup() {
});
// Add change listener to our quicksettings to change our internal config without the apply button for them
let quicksettings = gradioApp().querySelector('#quicksettings');
let commonQueryPart = "[id^=setting_tac] > label >";
let commonQueryPart = "[id^=setting_tac] > label";
quicksettings?.querySelectorAll(`${commonQueryPart} input, ${commonQueryPart} textarea, ${commonQueryPart} select`).forEach(e => {
e.addEventListener("change", () => {
setTimeout(async () => {
@@ -863,6 +863,13 @@ async function setup() {
}, 500);
});
});
quicksettings?.querySelectorAll(`[id^=setting_tac].gradio-dropdown input`).forEach(e => {
observeElement(e, "value", () => {
setTimeout(async () => {
await syncOptions();
}, 500);
})
});
// Add mutation observer for the model hash text to also allow hash-based blacklist again
let modelHashText = gradioApp().querySelector("#sd_checkpoint_hash");