diff --git a/js/lib/ui.js b/js/lib/ui.js index a835567..28c1b1d 100644 --- a/js/lib/ui.js +++ b/js/lib/ui.js @@ -235,7 +235,7 @@ function createAutoComplete(name, wrapper, options = {}) { onchange: new Observer(), get value() { - const v = this._selectedOptions.map((opt) => opt.value); + const v = Array.from(this._selectedOptions).map((opt) => opt.value); return options.multiple ? v : v[0]; }, set value(values) { diff --git a/js/lib/util.js b/js/lib/util.js index c07ca2a..ef90c6b 100644 --- a/js/lib/util.js +++ b/js/lib/util.js @@ -307,8 +307,10 @@ function downloadCanvas(options = {}) { ? cropCanvas(options.canvas).canvas : options.canvas; if (croppedCanvas != null) { - link.href = croppedCanvas.toDataURL("image/png"); - link.click(); + croppedCanvas.toBlob((blob) => { + link.href = URL.createObjectURL(blob); + link.click(); + }); } }