fix autocomplete value reader and now use blob

It should fix #93

Signed-off-by: Victor Seiji Hariki <victorseijih@gmail.com>
This commit is contained in:
Victor Seiji Hariki 2022-12-13 23:54:38 -03:00
parent 59b2d451fe
commit 7a96d77a7e
2 changed files with 5 additions and 3 deletions

View file

@ -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) {

View file

@ -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();
});
}
}