You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A title tag added using <svelte:head>, cannot be removed? like you can with any other tag i have tested (meta, script).
Reproduction
<svelte:head>
{#if toggleBool}
<!-- stays put even if toggleBool is false --><title>Title injected!!!</title><!-- gets removed as expected --><metaname="description" content="I am ALIVE" />
<!-- gets removed as expected --><script>console.log('I am alive!');</script>
{/if}
</svelte:head>
I think thats on purpose, because when you would remove the title, without setting a new one the page would have no title at all. So the only way to change the title is to set a new one.
You could of cause keep track of the previeous titles and set it to the last one. This could be a possible solution
<!-- src/routes/+page.svelte --><svelte:head><title>Home</title></svelte:head><ahref="/404">Go to 404 page</a>
Give the above example a direct call to "/404" will result in the title "Fallback" while a call using CSR will result in the old title "Home" still being displayed instead of the fallback one.
Describe the bug
A title tag added using
<svelte:head>
, cannot be removed? like you can with any other tag i have tested (meta, script).Reproduction
Relevant repl: https://svelte.dev/repl/2ecf81b43d0d4b2eaa02d80adf803929?version=3.48.0
Logs
No response
System Info
Windows 10, Firefox & Edge, svelte repl 3.48.0
Severity
annoyance
The text was updated successfully, but these errors were encountered: