-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
bugSomething isn't workingSomething isn't workinglow hanging fruitready to implementplease submit PRs for these issues!please submit PRs for these issues!
Milestone
Description
Describe the bug
When the URL hash value is changed using the address bar, the $page store is not updated.
Reproduction
Checked on Chrome, Firefox, and Safari. Reference 'System Info' for version numbers.
<script>
import { page } from '$app/stores';
$: console.log($page.url.hash);
</script>
<svelte:window
on:hashchange={() => {
console.log($page.url.hash, 'store');
console.log(window.location.hash, 'location')
}}
/>
<a href="#1">#1</a>- Load the page
- Click the anchor element.
- Replace
#1with#2in the address bar. - Check the console.
<!-- Anchor is clicked. Hash is now #1 -->
#1
#1 store
#1 location
<!-- URL is updated. Hash is now #2 -->
#1 store
#2 locationLogs
No response
System Info
System:
OS: macOS 13.2.1
CPU: (8) arm64 Apple M1
Memory: 78.86 MB / 8.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.14.1 - ~/.nvm/versions/node/v18.14.1/bin/node
npm: 9.3.1 - ~/.nvm/versions/node/v18.14.1/bin/npm
Browsers:
Chrome: 110.0.5481.177
Firefox: 110.0
Safari: 16.3
npmPackages:
@sveltejs/adapter-auto: ^2.0.0 => 2.0.0
@sveltejs/kit: ^1.5.0 => 1.11.0
svelte: ^3.54.0 => 3.55.1
vite: ^4.0.0 => 4.1.4Severity
annoyance
Additional Information
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinglow hanging fruitready to implementplease submit PRs for these issues!please submit PRs for these issues!