fix dioxus-tui events
This commit is contained in:
1 parent
0ab7a02777
commit
d06e64e5ad
19 files changed
+221
-21
No files matched your search
@@ -1,3 +1,4 @@
|
||||
use dioxus_html::HasFormData;
|
||||
use dioxus_native_core::{
|
||||
prelude::*,
|
||||
real_dom::{NodeImmutable, NodeTypeMut},
|
||||
@@ -79,7 +80,7 @@ impl Driver for Counter {
|
||||
if event_type == "input" {
|
||||
// when the button is clicked, increment the counter
|
||||
if let EventData::Form(input_event) = &*event {
|
||||
if let Ok(value) = input_event.value.parse::<f64>() {
|
||||
if let Ok(value) = input_event.value().parse::<f64>() {
|
||||
self.count = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,18 +57,18 @@ impl EventData {
|
||||
EventData::Keyboard(k) => Rc::new(k),
|
||||
EventData::Focus(f) => Rc::new(f),
|
||||
EventData::Wheel(w) => Rc::new(w),
|
||||
EventData::Form(f) => Rc::new(f.into_html()),
|
||||
EventData::Form(f) => Rc::new(f),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct FormData {
|
||||
pub value: String,
|
||||
pub(crate) value: String,
|
||||
|
||||
pub values: HashMap<String, Vec<String>>,
|
||||
pub(crate) values: HashMap<String, Vec<String>>,
|
||||
|
||||
pub files: Option<Files>,
|
||||
pub(crate) files: Option<Files>,
|
||||
}
|
||||
|
||||
impl HasFormData for FormData {
|
||||
@@ -85,12 +85,6 @@ impl HasFormData for FormData {
|
||||
}
|
||||
}
|
||||
|
||||
impl FormData {
|
||||
fn into_html(self) -> dioxus_html::FormData {
|
||||
dioxus_html::FormData::new(self)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct Files {
|
||||
files: FxHashMap<String, File>,
|
||||
|
||||
Reference in new issue
Block a user