mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-23 12:43:08 +00:00
fix FormValue
This commit is contained in:
parent
20bbf95979
commit
4631050a04
2 changed files with 5 additions and 5 deletions
|
@ -13,7 +13,7 @@ use dioxus_html::geometry::{
|
||||||
use dioxus_html::input_data::keyboard_types::{Code, Key, Location, Modifiers};
|
use dioxus_html::input_data::keyboard_types::{Code, Key, Location, Modifiers};
|
||||||
use dioxus_html::input_data::MouseButtonSet as DioxusMouseButtons;
|
use dioxus_html::input_data::MouseButtonSet as DioxusMouseButtons;
|
||||||
use dioxus_html::input_data::{MouseButton as DioxusMouseButton, MouseButtonSet};
|
use dioxus_html::input_data::{MouseButton as DioxusMouseButton, MouseButtonSet};
|
||||||
use dioxus_html::{event_bubbles, FocusData, KeyboardData, MouseData, ValueType, WheelData};
|
use dioxus_html::{event_bubbles, FocusData, KeyboardData, MouseData, FormValue, WheelData};
|
||||||
use std::any::Any;
|
use std::any::Any;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::{
|
use std::{
|
||||||
|
@ -61,7 +61,7 @@ impl EventData {
|
||||||
pub struct FormData {
|
pub struct FormData {
|
||||||
pub value: String,
|
pub value: String,
|
||||||
|
|
||||||
pub values: HashMap<String, ValueType>,
|
pub values: HashMap<String, FormValue>,
|
||||||
|
|
||||||
pub files: Option<Files>,
|
pub files: Option<Files>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
use dioxus_core::{
|
use dioxus_core::{
|
||||||
BorrowedAttributeValue, ElementId, Mutation, Template, TemplateAttribute, TemplateNode,
|
BorrowedAttributeValue, ElementId, Mutation, Template, TemplateAttribute, TemplateNode,
|
||||||
};
|
};
|
||||||
use dioxus_html::{event_bubbles, CompositionData, FormData, MountedData, ValueType};
|
use dioxus_html::{event_bubbles, CompositionData, FormData, MountedData, FormValue};
|
||||||
use dioxus_interpreter_js::{get_node, minimal_bindings, save_template, Channel};
|
use dioxus_interpreter_js::{get_node, minimal_bindings, save_template, Channel};
|
||||||
use futures_channel::mpsc;
|
use futures_channel::mpsc;
|
||||||
use js_sys::Array;
|
use js_sys::Array;
|
||||||
|
@ -377,9 +377,9 @@ fn read_input_to_data(target: Element) -> Rc<FormData> {
|
||||||
let item_values: Vec<String> =
|
let item_values: Vec<String> =
|
||||||
item_values.iter().filter_map(|v| v.as_string()).collect();
|
item_values.iter().filter_map(|v| v.as_string()).collect();
|
||||||
|
|
||||||
values.insert(name, ValueType::VecText(item_values));
|
values.insert(name, FormValue::VecText(item_values));
|
||||||
} else if let Ok(item_value) = array.get(1).dyn_into::<JsValue>() {
|
} else if let Ok(item_value) = array.get(1).dyn_into::<JsValue>() {
|
||||||
values.insert(name, ValueType::Text(item_value.as_string().unwrap()));
|
values.insert(name, FormValue::Text(item_value.as_string().unwrap()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue