1. optimize import.

2. modify post event serialization.
This commit is contained in:
Bunny Bites 2023-11-10 23:32:41 +05:30
parent 6398af1d65
commit 2b459e6fc1
2 changed files with 13 additions and 4 deletions

View file

@ -453,8 +453,18 @@ function handler(event, name, bubbles, config) {
const formData = new FormData(target);
for (let name of formData.keys()) {
let value = formData.getAll(name);
contents.values[name] = value;
const fieldType = form.elements[name].type;
switch (fieldType) {
case "select-multiple":
contents.values[name] = formData.getAll(name);
break;
// add cases for fieldTypes that can hold multiple values here
default:
contents.values[name] = formData.get(name);
break;
}
}
}

View file

@ -13,8 +13,7 @@ use dioxus_html::geometry::{
use dioxus_html::input_data::keyboard_types::{Code, Key, Location, Modifiers};
use dioxus_html::input_data::MouseButtonSet as DioxusMouseButtons;
use dioxus_html::input_data::{MouseButton as DioxusMouseButton, MouseButtonSet};
use dioxus_html::ValueType;
use dioxus_html::{event_bubbles, FocusData, KeyboardData, MouseData, WheelData};
use dioxus_html::{event_bubbles, FocusData, KeyboardData, MouseData, ValueType, WheelData};
use std::any::Any;
use std::collections::HashMap;
use std::{