Skip to content

Conversation

@xiaodong2008
Copy link
Contributor

This Pull Request Fix issue #3226: No onAfterRouteChanged called after popstate

In src/client/app/router.ts popstate eventListener, it should call onAfterRouteChanged hook after loadPage,
but it is missing.

...
    window.addEventListener('popstate', (e) => {
      loadPage(
        normalizeHref(location.href),
        (e.state && e.state.scrollPosition) || 0
-      )
+      ).then(() => {
+        router.onAfterRouteChanged?.(location.href)
+      })
    })
...

Before Fix:
Screenshot 2023-11-20 at 9 26 52 PM

After Fix:
Screenshot 2023-11-20 at 9 29 02 PM

@brc-dd brc-dd merged commit 60fc8fd into vuejs:main Nov 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants