From 984a7388f1062a29584c6db6432068f7793be040 Mon Sep 17 00:00:00 2001 From: Greg Johnston Date: Mon, 24 Jul 2023 11:25:28 -0400 Subject: [PATCH] fix: clear `` correctly when navigating between pages (closes #1369) (#1428) --- meta/src/title.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/src/title.rs b/meta/src/title.rs index 9109c036d..261b9ab37 100644 --- a/meta/src/title.rs +++ b/meta/src/title.rs @@ -125,6 +125,7 @@ pub fn Title( match document().query_selector("title") { Ok(Some(title)) => title.unchecked_into(), _ => { + let el_ref = meta.title.el.clone(); let el = document().create_element("title").unwrap_throw(); let head = document().head().unwrap_throw(); head.append_child(el.unchecked_ref()) @@ -134,6 +135,7 @@ pub fn Title( let el = el.clone(); move || { _ = head.remove_child(&el); + *el_ref.borrow_mut() = None; } });