Description
Describe the bug
When you have an svelte application which set's the title of the page on any route, while not setting the title of the page on other routes. The routes will keep the title of the previous route. This is not standard browser behavior and can easily confuse users. Instead svelte should remove the <title>
tag from the page to not confuse users.
Reproduction
A repository containing the code to reproduce: https://github.com/UnlimitedBytes/sveltekit-csr-title-bug
You will need to change the let defaultLink = false;
inside src\routes\+layout.svelte
to see the different behavior between default browser routing and svelte routing. A value of true
will use default browser routing while a value of false
will use svelte's routing.
A hosted version of the above repository can be found here: https://svelte-csr-title-issue.surge.sh/
Because we can't change the let defaultLink
value on this website I rendered both versions of the application statically and moved them to the following subfolders:
- https://svelte-csr-title-issue.surge.sh/svelte-routing ~ For Svelte's routing behavior
- https://svelte-csr-title-issue.surge.sh/default-routing ~ For the browser's routing behavior
Logs
Not needed
System Info
Not needed
Severity
serious, but I can work around it
Additional Information
Not needed