[material][Tabs] Disable scroll animation via prop #42181
Labels
component: tabs
This is the name of the generic UI component, not the React module!
new feature
New feature or request
package: material-ui
Specific to @mui/material
status: waiting for maintainer
These issues haven't been looked at yet by a maintainer
Summary
An additional prop should be added to
Tabs
that disables the scroll animations. The functionality for disabling the scroll animation is already built-in, but it is not exposed as a prop. I'd recommenddisableScrollAnimation
.Examples
None needed.
Motivation
When using scrollable tabs in frameworks with ssr and rehydration, scrolling occurs when the tabs are first loaded.
While preventing scroll on initial mounting was said to be fixed in #25469, this solution does not appear to work when using frameworks like Next.js (though it does work in vanilla react).
This is especially annoying as in Next.js layout components are remounted on navigation, causing the tabs to re-scroll on every navigation in some scenarios.
I'd like to be able to disable the scroll animations directly.
You can see this problem in action on my website in mobile view on certain pages: https://panfactum.com/docs/reference/infrastructure-modules/aws_dnssec.
Source code here: https://github.com/Panfactum/stack/blob/5fec677b42707b0dc49fd6b7d5bd76352f7985dc/packages/website/src/components/layout/web/secondary/tabs/CustomRenderedTabs.tsx#L58
Search keywords: tabs disable scroll
The text was updated successfully, but these errors were encountered: