Skip to content

Commit 60da4b4

Browse files
authored
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
1 parent c4f16af commit 60da4b4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

crates/eframe/src/web/events.rs

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

247248
Ok(())

0 commit comments

Comments
 (0)