mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
fix: unmount meta tags when state is dropped, because parents won't unmount them (closes #2832)
This commit is contained in:
parent
1b276e1e02
commit
2dde9738b2
1 changed files with 9 additions and 0 deletions
|
@ -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(|| {
|
||||
|
|
Loading…
Reference in a new issue