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

+24
View File
@@ -0,0 +1,24 @@
use dioxus_html::HasFileData;
use super::Synthetic;
impl HasFileData for Synthetic<web_sys::Event> {
#[cfg(feature = "file_engine")]
fn files(&self) -> Option<std::sync::Arc<dyn dioxus_html::FileEngine>> {
use wasm_bindgen::JsCast;
let files = self
.event
.dyn_ref()
.and_then(|input: &web_sys::HtmlInputElement| {
input.files().and_then(|files| {
#[allow(clippy::arc_with_non_send_sync)]
crate::file_engine::WebFileEngine::new(files).map(|f| {
std::sync::Arc::new(f) as std::sync::Arc<dyn dioxus_html::FileEngine>
})
})
});
files
}
}