fix navigating when files are dropped

This commit is contained in:
Jonathan Kelley committed 2024-03-01 23:37:46 -08:00
1 parent 0ff0eb7846
commit 199173a409
23 files changed
+1242 -1026

No files matched your search

+6 -10
View File
@@ -30,23 +30,19 @@ pub fn mock_event(id: &'static str, value: &'static str) {
}
pub fn mock_event_with_extra(id: &'static str, value: &'static str, extra: &'static str) {
EXPECTED_EVENTS.with_mut(|x| *x += 1);
use_hook(move || {
EXPECTED_EVENTS.with_mut(|x| *x += 1);
spawn(async move {
tokio::time::sleep(std::time::Duration::from_millis(5000)).await;
let js = format!(
r#"
//console.log("ran");
// Dispatch a synthetic event
let event = {};
let element = document.getElementById('{}');
console.log(element, event);
{}
let event = {value};
let element = document.getElementById('{id}');
{extra}
element.dispatchEvent(event);
"#,
value, id, extra
"#
);
eval(&js).await.unwrap();