The example from the documentation doesn't work. Link + [...catchAll] does not close modal window #65100
Replies: 8 comments 7 replies
-
Hi @MrOxMasTer -- does the modal close for you if you add a I can see how the docs are a bit unclear here, so I'll get those updated. |
Beta Was this translation helpful? Give feedback.
-
I deleted page.tsx to check, but it was there before and also didn't work on 14.2.3. |
Beta Was this translation helpful? Give feedback.
-
I read your comment about this and about the suggestion to support [[...catchAll]] in special routes and so also tried your way but it doesn't work still |
Beta Was this translation helpful? Give feedback.
-
I tried your provided reproduction and it works fine if I add a CleanShot.2024-04-26.at.14.05.12.mp4Please provide an updated reproduction for us to look into this for you. Thanks! |
Beta Was this translation helpful? Give feedback.
-
So, I deleted the .next folder and ran it again and it worked! Then let me ask you another question. Do I understand correctly that in this situation it can only lead to the home page? It seems logical, because the link is to the main page, but maybe somehow it can be realised by intercepts? Because when testing on other pages, it doesn't return to the main page all the time. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Maybe it's not supposed to happen that way? There are just very few scenarios using this approach, when every time the modal window closed it took me to the main page (‘/’) and it's not a good user experience |
Beta Was this translation helpful? Give feedback.
-
Link to the code that reproduces this issue
https://github.com/hqw567/nextgram
To Reproduce
Current vs. Expected behavior
Current Behavior:
When navigating away from an Intercepting Route using router.push('/') or <Link href={'/'}>, the Intercepting Route's component does not unmount or close, leaving the Intercepting Route's state or UI still active or visible in the background.
Expected Behavior:
Upon navigating away from an Intercepting Route using either router.push('/') or a <Link href={'/'}>, the Intercepting Route's component should unmount and close properly, similar to how it behaves when using router.back(). This ensures a consistent and predictable navigation experience within Next.js applications.
Provide environment information
Which area(s) are affected? (Select all that apply)
Parallel & Intercepting Routes
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
#62430
https://nextjs.org/docs/app/building-your-application/routing/parallel-routes#closing-the-modal
It's exactly the same situation. The modal window does not close.
Beta Was this translation helpful? Give feedback.
All reactions