fix: unmount meta tags when state is dropped, because parents won't unmount them (closes #2832)

This commit is contained in:
Greg Johnston 2024-08-16 17:51:37 -04:00
parent 1b276e1e02
commit 2dde9738b2
1 changed files with 9 additions and 0 deletions

View File

@ -364,6 +364,15 @@ where
state: <HtmlElement<E, At, Ch, Dom> as Render<Dom>>::State,
}
impl<E, At, Ch> Drop for RegisteredMetaTagState<E, At, Ch>
where
HtmlElement<E, At, Ch, Dom>: Render<Dom>,
{
fn drop(&mut self) {
self.state.unmount();
}
}
fn document_head() -> HtmlHeadElement {
let document = document();
document.head().unwrap_or_else(|| {