-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Provide a general summary of the issue here
When using RouterProvider
from react-aria-components
in a Next.js app, a modal in the shared navbar reopens after navigation if the destination page contains a Tailwind Typography prose
element.
This happens even though the modal state is closed in the navbar.
The bug only occurs:
- in production builds
- in Chrome
- when
RouterProvider
is used
Sometimes in development, or when not using RouterProvider
, the issue does not occur.
🤔 Expected Behavior?
After navigation, the modal should stay closed since the navbar state remains false
.
😯 Current Behavior
- On Chrome (production build, mostly), the modal reopens automatically after navigating to a page containing
prose
styles. - The internal state in the navbar remains
false
. - No error messages are shown.
🔗 Online reproduction: https://teo-bug-modal.q1xahd.easypanel.host
📦 Repo reproduction: https://github.com/teo-goulois/bug-modal-with-tailwindcss-typography-and-rac
💁 Possible Solution
Not sure yet — the issue seems related to the interaction between RouterProvider
navigation handling and Tailwind Typography’s prose
styles in production. It could be causing an unexpected re-render or focus/overlay trigger.
🔦 Context
I’m trying to use a shared navbar modal for navigation in my Next.js app. This bug breaks the UX because the modal immediately reopens after redirecting to some pages, even though I expect it to stay closed.
🖥️ Steps to Reproduce
- Clone the repo: bug-modal-with-tailwindcss-typography-and-rac
- Run
npm run build && npm start
- Open the navbar modal and click a navigation link
- Navigate to a page containing
<div className="prose">...</div>
- Observe that the modal reopens automatically
Or test directly with the online reproduction:
👉 https://teo-bug-modal.q1xahd.easypanel.host
Version
"react-aria-components": "^1.10.1"
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
macOS
🧢 Your Company/Team
Lumy
🕷 Tracking Issue
No response