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
When utilizing NextIntlLink from next-intl/link to navigate between sections of a page using hash links (e.g., #section1), the "hashchange" event is not being triggered as expected. This issue is critical for functionalities that rely on detecting hash changes in the URL, such as scroll-spy utilities, dynamic section highlighting, and single-page applications (SPAs) that need to manage state based on URL hash fragments.
Mandatory reproduction URL (CodeSandbox or GitHub repository)
A function attached to the "hashchange" event is only called when the hash is changed from the browser search bar, but not when a link with a hash is clicked.
The text was updated successfully, but these errors were encountered:
Yep, that seems to be the case! Link from next-intl only wraps next/link, therefore we inherit all the functionality from that component. You might want to report this issue upstream.
Description
When utilizing NextIntlLink from next-intl/link to navigate between sections of a page using hash links (e.g., #section1), the "hashchange" event is not being triggered as expected. This issue is critical for functionalities that rely on detecting hash changes in the URL, such as scroll-spy utilities, dynamic section highlighting, and single-page applications (SPAs) that need to manage state based on URL hash fragments.
Mandatory reproduction URL (CodeSandbox or GitHub repository)
https://codesandbox.io/p/sandbox/next-intl-bug-template-app-forked-xn388f?file=%2Fsrc%2Fapp%2F%5Blocale%5D%2Fpage.tsx%3A30%2C9
Reproduction description
Steps to reproduce:
Expected behaviour
A function attached to the "hashchange" event is only called when the hash is changed from the browser search bar, but not when a link with a hash is clicked.
The text was updated successfully, but these errors were encountered: