1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

Web: repaint if the #hash in the URL changes (#4261)

Fixes a problem in egui.rs where the back-button would not work to
switch between the top-level tabs
This commit is contained in:
Emil Ernerfeldt
2024-03-29 10:59:24 +01:00
committed by GitHub
parent c4f16af721
commit 60da4b4f65

View File

@@ -242,6 +242,7 @@ pub(crate) fn install_window_events(runner_ref: &WebRunner) -> Result<(), JsValu
runner_ref.add_event_listener(&window, "hashchange", |_: web_sys::Event, runner| {
// `epi::Frame::info(&self)` clones `epi::IntegrationInfo`, but we need to modify the original here
runner.frame.info.web_info.location.hash = location_hash();
runner.needs_repaint.repaint_asap(); // tell the user about the new hash
})?;
Ok(())