Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using router.replace() from next/navigation for routing, the modal opened with the next.js slot does not close. #71795

Open
2dubbing opened this issue Oct 24, 2024 · 0 comments
Labels
bug Issue was opened via the bug report template. create-next-app Related to our CLI tool for quickly starting a new Next.js application.

Comments

@2dubbing
Copy link

2dubbing commented Oct 24, 2024

Link to the code that reproduces this issue

https://github.com/2dubbing/nextgram

To Reproduce

  1. npm install
  2. npm run dev
  3. Open web browser http://localhost:3000
  4. Click the square UI with the number on it on the screen.
  5. Click the X button in the modal window.

Current vs. Expected behavior

Current: �If you route with router.replace() while the modal window is open, the modal window will not close.

Expected behavior: Routing with router.replace() should close any open modal windows.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.0.0: Mon Aug 12 20:51:54 PDT 2024; root:xnu-11215.1.10~2/RELEASE_ARM64_T6000
  Available memory (MB): 16384
  Available CPU cores: 10
Binaries:
  Node: 20.18.0
  npm: 10.8.2
  Yarn: N/A
  pnpm: 9.6.0
Relevant Packages:
  next: 15.0.0-canary.61
  react: 19.0.0-rc.0
  react-dom: 19.0.0-rc.0
  typescript: 5.5.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

create-next-app

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

You might want to use router.replace for the following reasons
Because we think it's better for usability to use router.replace rather than router.back if the data change is successful on the Change Form Data page.

thank you.

@2dubbing 2dubbing added the bug Issue was opened via the bug report template. label Oct 24, 2024
@github-actions github-actions bot added the create-next-app Related to our CLI tool for quickly starting a new Next.js application. label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. create-next-app Related to our CLI tool for quickly starting a new Next.js application.
Projects
None yet
Development

No branches or pull requests

1 participant