-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Which project does this relate to?
Router
Describe the bug
ignoreBlocker seems to not work when navigating externally.
useBlocker still blocks when navigating with navigate({ ignoreBlocker: true })
When navigating internally using to - the ignoreBlocker works as expected
<Link to="/foo" ignoreBlocker>ROUTE 1 --- IGNORE BLOCKER</Link>But when navigating externally using href - the ignoreBlocker is ignored - resulting the browser confirm message to apear.
navigate({
href: 'https://tanstack.com/',
ignoreBlocker: true,
reloadDocument: true,
})This seems to be the same for when reloadDocument is on or off
Your Example Website or App
https://stackblitz.com/edit/tanstack-router-c7zvzz1m?file=src%2Fmain.tsx
Steps to Reproduce the Bug or Issue
- Set a blocker
- navigate to an external link (using href) with ignoreBlocker=true
- The navigation is blocked even though ignoreBlocker is on
Expected behavior
Expecting the ignoreBlocker to work the same as it does when the navigation is internal
Screenshots or Videos
No response
Platform
- Router / Start Version: 1.130.9
- OS: macOS
- Browser: Chrome
- Bundler: [e.g. vite]
Additional context
Seems like the navigate fn returns before reaching the history section when the ignoreBlocker is being checked.
the ignoreNextBeforeUnload never get set to true like it does when navigating internally