App Dir: Avoid intercepted route for hard navigated page
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.5k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 351
Description
Verify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #22 SMP Tue Jan 10 18:39:00 UTC 2023
Binaries:
Node: 18.14.2
npm: 9.5.0
Yarn: 1.22.19
pnpm: N/A
Relevant packages:
next: 13.4.7-canary.4
eslint-config-next: 13.4.7
react: 18.2.0
react-dom: 18.2.0
typescript: 5.0.4
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
Link to the code that reproduces this issue or a replay of the bug
https://codesandbox.io/p/sandbox/dazzling-hooks-fz6pjv
To Reproduce
- Run the code sandbox
- Navigate to the search modal using the Search button
- Type a query
- Refresh the page, full search page should open
- Update the search query using input control
- The search modal should also show up, along with the page updated.
The search modal should not show up.
Describe the Bug
- The home page contains list of articles.
- There is a Search button that opens the intercepted
/searchroute in a Modal - On typing in the input, search is supposed to happen (not implemented), url is updated with query string. e.g. /search?q=food
All Good so far.
- Now when a User refreshes the page, the full search page appears. say for url
/search?q=food - On the page, if user tries to update the search query, the page is updated as well as opens the intercepted
/searchroute in a Modal
Since the user is already on the full /search page, there should not be any requirement to again open the intercepted route
Expected Behavior
When updating the route with a new query string, the page should get updated and not show the intercepted route modal. As the page is already loaded and should not be again intercepted.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the linked CodeSandbox and reproducing the flow through the App Router: open the intercepted /search modal, refresh, then change the query string. Read the intercepted-route and hard-navigation behavior involved in the reproduction. Done means updating the query on the full /search page changes the page without reopening the modal.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, next.js, react
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100