Skip to content

Commit

Permalink
fix map is not a function
Browse files Browse the repository at this point in the history
  • Loading branch information
asukaminato0721 committed Jun 30, 2023
1 parent 079f1df commit ba69f22
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/dom/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,9 @@ p5.prototype.createSelect = function(...args) {
if (arg instanceof p5.Element && arg.elt instanceof HTMLSelectElement) {
// If given argument is p5.Element of select type
self = arg;
/**
* @type {HTMLSelectElement}
*/
this.elt = arg.elt;
} else if (arg instanceof HTMLSelectElement) {
self = addElement(arg, this);
Expand Down Expand Up @@ -760,7 +763,7 @@ p5.prototype.createSelect = function(...args) {
return this;
}
else if (this.elt.getAttribute('multiple')) {
return this.elt.selectedOptions.map(x=> x.value);
return [...this.elt.selectedOptions].map(x=> x.value);
}
else {
return this.elt.value;
Expand Down

0 comments on commit ba69f22

Please sign in to comment.