Merge branch 'upstream' into query-system

This commit is contained in:
Evan Almloff committed 2023-05-05 11:09:25 -05:00
commit 19436e210f
8 files changed
+63 -145

No files matched your search

+4 -1
View File
@@ -4,7 +4,8 @@ use serde::Deserialize;
#[derive(Debug, Deserialize)]
pub(crate) struct FileDiologRequest {
accept: String,
#[serde(default)]
accept: Option<String>,
multiple: bool,
pub event: String,
pub target: usize,
@@ -16,6 +17,8 @@ pub(crate) fn get_file_event(request: &FileDiologRequest) -> Vec<PathBuf> {
let filters: Vec<_> = request
.accept
.as_deref()
.unwrap_or_default()
.split(',')
.filter_map(|s| Filters::from_str(s).ok())
.collect();
+8 -8
View File
@@ -15,12 +15,12 @@ fn module_loader(root_name: &str) -> String {
let inputs = document.querySelectorAll("input");
for (let input of inputs) {
if (!input.getAttribute("data-dioxus-file-listener")) {
input.setAttribute("data-dioxus-file-listener", true);
input.addEventListener("click", (event) => {
let target = event.target;
// prevent file inputs from opening the file dialog on click
const type = target.getAttribute("type");
if (type === "file") {
// prevent file inputs from opening the file dialog on click
const type = input.getAttribute("type");
if (type === "file") {
input.setAttribute("data-dioxus-file-listener", true);
input.addEventListener("click", (event) => {
let target = event.target;
let target_id = find_real_id(target);
if (target_id !== null) {
const send = (event_name) => {
@@ -30,8 +30,8 @@ fn module_loader(root_name: &str) -> String {
send("change&input");
}
event.preventDefault();
}
});
});
}
}
}"#,
);