[Tabs] not working correctly with `react-router-dom`
See original GitHub issueBug report
Current Behavior
When content is long and you scroll down a bit, navigating to other route/tab with TabTrigger
with react router-dom Link
doesn’t change its route.
Here’s a video of showing it: https://streamable.com/vrw0hg
Expected behavior
When content is long and you scroll down a bit, navigating to other route/tab with TabTrigger
with react router-dom Link
should change its route.
Reproducible example
Your environment
Software | Name(s) | Version |
---|---|---|
Radix Package(s) | Tabs | 0.1.4 |
React | n/a | 17.0.2 |
Browser | Chrome | 97.0.4692.99 |
Assistive tech | ||
Node | n/a | |
npm/yarn | ||
Operating System |
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
MUI Nav Tabs does not work with react-router - Stack Overflow
1 Answer 1 · It's working fine. Thanks. You use the tab component in the route. · @MijanurRahman do the same thing just...
Read more >Routing with Tab does not work properly - Ionic React
When I tried to have a default route of / and a subroute with tabs When the page goes back to root route,...
Read more >Handling Tabs Using Page URLs and React Router Doms
Learn how to maintain your active tab by using URL parameters and leveraging React Router Dom instead of using React state.
Read more >Tab components - React-Bootstrap
Tabs is a higher-level component for quickly creating a Nav matched with a set ... Your monument shall be my gentle verse, Which...
Read more >Strict Mode - React
Detecting unexpected side effects. Conceptually, React does work in two phases: The render phase determines what changes need to be made to e.g....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@johnopleda ah, that is the same issue. The tab content is updating on pointer down so your mouse is not over the tab anymore when you release your pointer and click never fires on the
Link
to change the url.It seems the best solution would be to control it. Here’s a more declarative way of controlling that just dawned on me and wouldn’t mean a reliance on implementation detail remaining stable https://codesandbox.io/s/zen-frog-88tv3?file=/src/App.js
I really don’t know the answer tbh. I thought the same as you initially but then i found the youtube example which uses
role=tab
and it muddied the waters.what if you have tabs in your app that aren’t app navigation (so no
aria-current
) and then the boss asks for them to have permalink functionality for sharing? i’ve had this exact use-case before on a previous app where app state was in URL.