You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I dont know why but when we use a directly downloadable url in the handleDownload function this triggers the shouldBlockFn, and the only way to download is clicking in Leave in window confirmation....
....Looks like the Blocker from react-router identifies the download as a shouldBlock action...
I know this is a very specific issued, but im trying to solve this but i didnt got this yet...
Expected behavior
When we fill the Editor 1 Input and click in Download CSV the react-router should NOT trigger the shouldBlockFn.
Screenshots or Videos
No response
Platform
OS: Wndows 11
Browser: Chrome
Version: 131.0.6778.266
Additional context
No response
The text was updated successfully, but these errors were encountered:
ManoelPradoMark22
changed the title
react-router Navigation Blocker blocks downloadable url
react-router Navigation Blocking: mistakenly blocks downloadable url
Jan 21, 2025
Which project does this relate to?
Router
Describe the bug
The react-router Blocking identifies the File download from a downloadable url as a tentative of leaving the page.
Your Example Website or App
Live DEMO: https://manoelpradomark22.github.io/react-router-blocker-bug/editor-1
If wants the code: https://github.com/ManoelPradoMark22/react-router-blocker-bug (see the README)
P.S.: I based on this react-router example: https://tanstack.com/router/latest/docs/framework/react/examples/navigation-blocking
Steps to Reproduce the Bug or Issue
2 . write something in Editor 1 input
const handleDownload = (url: string) => { const link = document.createElement("a"); link.href = url; document.body.appendChild(link); link.click(); document.body.removeChild(link); };
Note: the downloadable url example: https://people.sc.fsu.edu/~jburkardt/data/csv/addresses.csv
I dont know why but when we use a directly downloadable url in the handleDownload function this triggers the shouldBlockFn, and the only way to download is clicking in Leave in window confirmation....
....Looks like the Blocker from react-router identifies the download as a shouldBlock action...
I know this is a very specific issued, but im trying to solve this but i didnt got this yet...
Expected behavior
When we fill the Editor 1 Input and click in Download CSV the react-router should NOT trigger the shouldBlockFn.
Screenshots or Videos
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: