mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 14:20:04 -04:00
Remove prevent_default for mousedown events (#1209)
This fixes the issue of tabs not focusing when egui is used inside vscode
This commit is contained in:
@@ -835,7 +835,7 @@ fn install_canvas_events(runner_ref: &AppRunnerRef) -> Result<(), JsValue> {
|
|||||||
runner_lock.needs_repaint.set_true();
|
runner_lock.needs_repaint.set_true();
|
||||||
}
|
}
|
||||||
event.stop_propagation();
|
event.stop_propagation();
|
||||||
event.prevent_default();
|
// Note: prevent_default breaks VSCode tab focusing, hence why we don't call it here.
|
||||||
}) as Box<dyn FnMut(_)>);
|
}) as Box<dyn FnMut(_)>);
|
||||||
canvas.add_event_listener_with_callback(event_name, closure.as_ref().unchecked_ref())?;
|
canvas.add_event_listener_with_callback(event_name, closure.as_ref().unchecked_ref())?;
|
||||||
closure.forget();
|
closure.forget();
|
||||||
|
|||||||
Reference in New Issue
Block a user