add impl fn for FormData to get input types
This commit is contained in:
1 parent
1a9d1eda19
commit
2cbbdc23c6
7 files changed
+38
-2
No files matched your search
@@ -63,6 +63,8 @@ pub struct FormData {
|
||||
|
||||
pub values: HashMap<String, Vec<String>>,
|
||||
|
||||
pub value_types: HashMap<String, String>,
|
||||
|
||||
pub files: Option<Files>,
|
||||
}
|
||||
|
||||
@@ -71,6 +73,7 @@ impl FormData {
|
||||
dioxus_html::FormData {
|
||||
value: self.value,
|
||||
values: self.values,
|
||||
value_types: self.value_types,
|
||||
files: None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,6 +93,7 @@ impl Button {
|
||||
let data = FormData {
|
||||
value: self.value.to_string(),
|
||||
values: HashMap::new(),
|
||||
value_types: HashMap::new(),
|
||||
files: None,
|
||||
};
|
||||
ctx.send(crate::Event {
|
||||
|
||||
@@ -129,6 +129,7 @@ impl CheckBox {
|
||||
.then(|| self.value.to_string())
|
||||
.unwrap_or_default(),
|
||||
values: HashMap::new(),
|
||||
value_types: HashMap::new(),
|
||||
files: None,
|
||||
};
|
||||
{
|
||||
|
||||
@@ -198,6 +198,7 @@ impl Slider {
|
||||
let data = FormData {
|
||||
value: self.value.to_string(),
|
||||
values: HashMap::new(),
|
||||
value_types: HashMap::new(),
|
||||
files: None,
|
||||
};
|
||||
ctx.send(Event {
|
||||
|
||||
@@ -171,6 +171,7 @@ impl<C: TextLikeController> TextLike<C> {
|
||||
let data: FormData = FormData {
|
||||
value: self.text.clone(),
|
||||
values: HashMap::new(),
|
||||
value_types: HashMap::new(),
|
||||
files: None,
|
||||
};
|
||||
let ctx: UniqueView<WidgetContext> = world.borrow().expect("expected widget context");
|
||||
|
||||
Reference in new issue
Block a user