diff --git a/frappe/public/js/frappe/ui/capture.js b/frappe/public/js/frappe/ui/capture.js index 1d40f50485..aeca245857 100644 --- a/frappe/public/js/frappe/ui/capture.js +++ b/frappe/public/js/frappe/ui/capture.js @@ -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(); };