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

[material][Tabs] Disable scroll animation via prop #42181

Open
fullykubed opened this issue May 9, 2024 · 0 comments
Open

[material][Tabs] Disable scroll animation via prop #42181

fullykubed opened this issue May 9, 2024 · 0 comments
Assignees
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

Comments

@fullykubed
Copy link

fullykubed commented May 9, 2024

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 recommend disableScrollAnimation.

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

@fullykubed fullykubed added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 9, 2024
@brijeshb42 brijeshb42 self-assigned this May 10, 2024
@brijeshb42 brijeshb42 added component: tabs This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material enhancement This is not a bug, nor a new feature new feature New feature or request and removed enhancement This is not a bug, nor a new feature labels May 10, 2024
@brijeshb42 brijeshb42 changed the title [Tabs] Disable scroll animation via prop [material][Tabs] Disable scroll animation via prop May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants