Skip to content

fix(history): add ignoreBlocker support to go method (#4867) - #4872

Closed
KSJ27 wants to merge 2 commits into
TanStack:mainfrom
KSJ27:fix/go-ignore-blocker
Closed

fix(history): add ignoreBlocker support to go method (#4867)#4872
KSJ27 wants to merge 2 commits into
TanStack:mainfrom
KSJ27:fix/go-ignore-blocker

Conversation

@KSJ27

@KSJ27KSJ27 commented Aug 6, 2025

Copy link
Copy Markdown

Description

Fixes GitHub issue #4867 - history.go does not respect ignoreBlocker option.

Currently, when using TanStack Router with BrowserHistory, the ignoreBlocker option works as expected for history.back and history.forward, but does not work for history.go. This means that navigation blockers are still triggered even when ignoreBlocker: true is passed to history.go.

Changes

Core Fix

  • packages/history/src/index.ts:
    • Add ignoreBlocker parameter to go method in createBrowserHistory
    • Update createHistory to pass ignoreBlocker to underlying go implementation
    • Ensure consistent behavior across back, forward, and go methods

Testing

  • packages/history/tests/ignoreBlocker.test.ts:
    • Test all navigation methods (back, forward, go) with ignoreBlocker option in createBrowserHistory

@LadyBluenotes

Copy link
Copy Markdown
Member

Thanks for the fix. The go path still needs this behaviour, but the current tests do not reach the browser popstate handler where blockers are actually skipped.

I’m closing this stale branch and keeping #4867 open for a fresh implementation with a behavioural BrowserHistory regression

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@KSJ27@LadyBluenotes