-
Notifications
You must be signed in to change notification settings - Fork 172
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Describe the bug
The "useBeforeLeave" hook seems to only be firing when navigating using links.
When using the browsers back/forth buttons it does not appear to execute.
Your Example Website or App
https://stackblitz.com/edit/solidjs-templates-ejhtft?file=src%2FApp.jsx
Steps to Reproduce the Bug or Issue
- Go to the "test" route using the nav link.
- Go back to the "home" routeusing the nav link.
- An alert "here" will show up
- Go back to the "test" route using the nav link.
- Click the "back" button (fires history.back())
- The route changes correctly, but the alert does not show up
Expected behavior
As a user i expeted the "useBeforeLeave" function to also fire when using the "back" button (either progromatically or with the actual browser buttons in a 'real' environment).
I am in both cases leaving the current route so I don't see why it shouln't execute.
Screenshots or Videos
No response
Platform
- OS: Windows
- Browser: Firefox
- Version: 114.0.2 (64-Bit)
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request