mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-23 04:33:06 +00:00
1. optimize import.
2. modify post event serialization.
This commit is contained in:
parent
6398af1d65
commit
2b459e6fc1
2 changed files with 13 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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::{
|
||||
|
|
Loading…
Reference in a new issue