fix(capture): Add input to DOM before emitting click on it (#24841)

This commit is contained in:
Corentin Flr 2024-02-20 15:59:39 +01:00 committed by GitHub
parent 64a5ebb112
commit bc0da15d20
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,6 +31,10 @@ function get_file_input() {
input.setAttribute("accept", "image/*");
input.setAttribute("multiple", "");
// Make sure that the input exists in the DOM
input.classList.add("visually-hidden");
document.body.appendChild(input);
return input;
}
@ -126,6 +130,10 @@ frappe.ui.Capture = class {
me.images.push(f);
}
// Remove the input from the DOM
me.input.remove();
me.input = null;
me.render_preview();
me.dialog.show();
};