Handle oninput for select elements

This commit is contained in:
Evan Almloff committed 2023-08-07 17:19:16 -07:00
1 parent a025617db3
commit c32d6dc8cb
1 file changed
+13 -4
+13 -4
View File
@@ -442,10 +442,6 @@ function handler(event, name, bubbles, config) {
/*POST_EVENT_SERIALIZATION*/ /*POST_EVENT_SERIALIZATION*/
if (
target.tagName === "FORM" &&
(event.type === "submit" || event.type === "input")
) {
if ( if (
target.tagName === "FORM" && target.tagName === "FORM" &&
(event.type === "submit" || event.type === "input") (event.type === "submit" || event.type === "input")
@@ -457,6 +453,19 @@ function handler(event, name, bubbles, config) {
contents.values[name] = value; contents.values[name] = value;
} }
} }
if (
target.tagName === "SELECT" &&
event.type === "input"
) {
const selectData = target.options;
contents.values["options"] = [];
for (let i = 0; i < selectData.length; i++) {
let option = selectData[i];
if (option.selected) {
contents.values["options"].push(option.value.toString());
}
}
} }
if (realId === null) { if (realId === null) {