fix(editor): fire an input event when the generator fills the password

Assigning .value fires nothing, and the code called soDirtyCheck by hand - so the strength bar, which listens to input, stayed frozen on the previous password. Dispatching the event covers every listener on the field instead of one named handler.
This commit is contained in:
r-zakarya
2026-08-07 12:03:42 +01:00
parent 485dd3631e
commit b9b098fe12
2 changed files with 12 additions and 3 deletions
+8 -1
View File
@@ -7670,7 +7670,14 @@ async function init() {
// 'standalone' target hides #genUse). The old entry-modal target is gone.
if (genTarget === 'slideover') {
const soPw = $('#soPassword');
if (soPw) { soPw.value = genCurrent; soDirtyCheck(); }
if (soPw) {
soPw.value = genCurrent;
// Assigning .value fires nothing. Dispatch the event the field
// already listens for, instead of calling one handler by hand:
// the strength bar listens to 'input' too and stayed frozen on
// the previous password. Anything wired later comes along free.
soPw.dispatchEvent(new Event('input', { bubbles: true }));
}
}
closeGen();
});