T
TanStack2mo ago
hilarious-sapphire

Blocker function

Hello dear Tanstack community, I have a tanstack router application. I have a form in my detail page and different tabs in this detail page. Since different tab resets the form, I used useBlocker in which there is some unsaved changes. It works in between switching page but not rehresing page (F5 when on the page). I decided to consult in here to get some information whether I am on right track or not?
No description
9 Replies
sensitive-blue
sensitive-blue2mo ago
what does not work when refreshing?
hilarious-sapphire
hilarious-sapphireOP2mo ago
it still asks me confirmation alert
No description
sensitive-blue
sensitive-blue2mo ago
can you create a complete example by forking one of the router stackblitz examples please?
hilarious-sapphire
hilarious-sapphireOP2mo ago
sure
sensitive-blue
sensitive-blue2mo ago
GitHub
Navigation always blocked with enableBeforeUnload true, even if ret...
Which project does this relate to? Router Describe the bug if enableBeforeUnload is set to true for a blocker it's always blocking browser navigation. Tested in Chrome Your Example Website or A...
hilarious-sapphire
hilarious-sapphireOP2mo ago
definitely, this was my question. Thanks for the exact point to the problem. I was doing stackblitz. Guess it is not needed anymore. Again, thank you I tested this and worked perfectly.
sensitive-blue
sensitive-blue2mo ago
in this issue they mentioned that this should be documented. if you want to help out, you could create a PR to the docs
hilarious-sapphire
hilarious-sapphireOP2mo ago
I will gladly create a PR if the dev in the thread doesnt create one since it is his solution first
sensitive-blue
sensitive-blue2mo ago
he just responded so lets wait a bit

Did you find this page helpful?