Synchronous prevent default (#2792)
* add prevent default methods to the event * sync prevent default almost working * sync prevent default working * Move event handling into the runtime * update core tests * restore desktop file dialog * implement prevent default on web * add a hint about the new prevent default method * fix web prevent default * Fix CTRL+click on links * fix values memorize in place test * Fix a few more tests * Add a playwright test for sync prevent default * Fix core doc tests * create a deprecated VirtualDom::handle_event * fix macos imports in desktop * Fix onmounted event * Fix liveview support * switch to RefCell for metadata * Remove println * remove prevent default attribute * remove web specific link behavior * Fix liveview links * more liveview fixes for link * Fix merge conflicts * Fix clippy * use the new prevent default in the file upload example
This commit is contained in:
1 parent
8b62b71e2d
commit
cab573eefd
54 files changed
+940
-729
No files matched your search
@@ -161,10 +161,10 @@ impl VNode {
|
||||
dom: &mut VirtualDom,
|
||||
mut to: Option<&mut impl WriteMutations>,
|
||||
) {
|
||||
let scope = ScopeId(dom.mounts[mount.0].mounted_dynamic_nodes[idx]);
|
||||
let scope = ScopeId(dom.get_mounted_dyn_node(mount, idx));
|
||||
|
||||
// Remove the scope id from the mount
|
||||
dom.mounts[mount.0].mounted_dynamic_nodes[idx] = ScopeId::PLACEHOLDER.0;
|
||||
dom.set_mounted_dyn_node(mount, idx, ScopeId::PLACEHOLDER.0);
|
||||
let m = self.create_component_node(mount, idx, new, parent, dom, to.as_deref_mut());
|
||||
|
||||
// Instead of *just* removing it, we can use the replace mutation
|
||||
@@ -188,7 +188,7 @@ impl VNode {
|
||||
return SuspenseBoundaryProps::create(mount, idx, component, parent, dom, to);
|
||||
}
|
||||
|
||||
let mut scope_id = ScopeId(dom.mounts[mount.0].mounted_dynamic_nodes[idx]);
|
||||
let mut scope_id = ScopeId(dom.get_mounted_dyn_node(mount, idx));
|
||||
|
||||
// If the scopeid is a placeholder, we need to load up a new scope for this vcomponent. If it's already mounted, then we can just use that
|
||||
if scope_id.is_placeholder() {
|
||||
@@ -198,7 +198,7 @@ impl VNode {
|
||||
.id;
|
||||
|
||||
// Store the scope id for the next render
|
||||
dom.mounts[mount.0].mounted_dynamic_nodes[idx] = scope_id.0;
|
||||
dom.set_mounted_dyn_node(mount, idx, scope_id.0);
|
||||
|
||||
// If this is a new scope, we also need to run it once to get the initial state
|
||||
let new = dom.run_scope(scope_id);
|
||||
@@ -207,7 +207,7 @@ impl VNode {
|
||||
dom.scopes[scope_id.0].last_rendered_node = Some(new);
|
||||
}
|
||||
|
||||
let scope = ScopeId(dom.mounts[mount.0].mounted_dynamic_nodes[idx]);
|
||||
let scope = ScopeId(dom.get_mounted_dyn_node(mount, idx));
|
||||
|
||||
let new_node = dom.scopes[scope.0]
|
||||
.last_rendered_node
|
||||
|
||||
Reference in new issue
Block a user