add bubbling data to events after merge
This commit is contained in:
1 parent
11d9a7d013
commit
2d45e1dc8d
2 files changed
+5
No files matched your search
@@ -6,6 +6,7 @@ use std::any::Any;
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use dioxus_core::{ElementId, EventPriority, UserEvent};
|
use dioxus_core::{ElementId, EventPriority, UserEvent};
|
||||||
|
use dioxus_html::event_bubbles;
|
||||||
use dioxus_html::on::*;
|
use dioxus_html::on::*;
|
||||||
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
#[derive(serde::Serialize, serde::Deserialize)]
|
||||||
@@ -46,6 +47,7 @@ pub fn trigger_from_serialized(val: serde_json::Value) -> UserEvent {
|
|||||||
scope_id: None,
|
scope_id: None,
|
||||||
element: mounted_dom_id,
|
element: mounted_dom_id,
|
||||||
data: event,
|
data: event,
|
||||||
|
bubbles: event_bubbles(name),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -187,6 +187,7 @@ impl InnerInputState {
|
|||||||
name: "focus",
|
name: "focus",
|
||||||
element: Some(id),
|
element: Some(id),
|
||||||
data: Arc::new(FocusData {}),
|
data: Arc::new(FocusData {}),
|
||||||
|
bubbles: event_bubbles("focus"),
|
||||||
});
|
});
|
||||||
resolved_events.push(UserEvent {
|
resolved_events.push(UserEvent {
|
||||||
scope_id: None,
|
scope_id: None,
|
||||||
@@ -194,6 +195,7 @@ impl InnerInputState {
|
|||||||
name: "focusin",
|
name: "focusin",
|
||||||
element: Some(id),
|
element: Some(id),
|
||||||
data: Arc::new(FocusData {}),
|
data: Arc::new(FocusData {}),
|
||||||
|
bubbles: event_bubbles("focusin"),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if let Some(id) = old_focus {
|
if let Some(id) = old_focus {
|
||||||
@@ -203,6 +205,7 @@ impl InnerInputState {
|
|||||||
name: "focusout",
|
name: "focusout",
|
||||||
element: Some(id),
|
element: Some(id),
|
||||||
data: Arc::new(FocusData {}),
|
data: Arc::new(FocusData {}),
|
||||||
|
bubbles: event_bubbles("focusout"),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user