Click the square UI with the number on it on the screen.
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.
I've also tried using useSelectedLayoutSegment() in @modal/layout.tsx to see if conditional rendering works, but I'm still experiencing the same issue.
Link to the code that reproduces this issue
https://github.com/2dubbing/nextgram
To Reproduce
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
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.