Remove native and web features from dioxus-html (#3006)

* remove native and web features from dioxus-html

* Fix downcasting web events

* Fix desktop with tokio disabled
This commit is contained in:
Evan Almloff authored and GitHub committed 2024-10-10 13:35:59 -07:00
1 parent 677e0e7f4f
commit cda8bb24f1
54 files changed
+1768 -1512

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
use dioxus_html::HasToggleData;
use super::{Synthetic, WebEventExt};
impl HasToggleData for Synthetic<web_sys::Event> {
fn as_any(&self) -> &dyn std::any::Any {
self
}
}
impl WebEventExt for dioxus_html::ToggleData {
type WebEvent = web_sys::Event;
#[inline(always)]
fn try_as_web_event(&self) -> Option<Self::WebEvent> {
self.downcast::<Synthetic<web_sys::Event>>()
.map(|e| e.event.clone())
}
}