Skip to content

Commit

Permalink
Remove prevent_default for mousedown events (#1209)
Browse files Browse the repository at this point in the history
This fixes the issue of tabs not focusing when egui is used inside vscode
  • Loading branch information
juancampa committed Feb 5, 2022
1 parent 712d8c9 commit ea28485
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion egui_web/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ fn install_canvas_events(runner_ref: &AppRunnerRef) -> Result<(), JsValue> {
runner_lock.needs_repaint.set_true();
}
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(_)>);
canvas.add_event_listener_with_callback(event_name, closure.as_ref().unchecked_ref())?;
closure.forget();
Expand Down

0 comments on commit ea28485

Please sign in to comment.