-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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-ui][Tabs] End scroll button overlaps last tab when it is the initial value #40692
Comments
I'd like to help with this. Can I try to solve this issue? |
I tried your code in a playground, @kealjones-wk , but it seems to be working normally, without any overlaping... Here is a gif of the page being loaded: |
I can reproduce this, as you noted, starting from version |
I just updated the issue description with some more details and an improved live example to https://codesandbox.io/p/sandbox/nostalgic-fog-9z6fzy which properly demos the issue. While fixing the demo I noticed some things:
It seems like it is a race condition between when the scrolling happens and when the scroll buttons are rendered into the dom. |
@kealjones-wk It does not occur intermittently for me with v18. It happens everytime. Here is the CodeSandbox using One thing I noticed is that it doesn't overlap during the initial render, meaning when I first open the CodeSandbox. |
I am facing the same issue. I have also noticed that this behaviour (as in the overlapping) is present in the actual documentation, see here: https://mui.com/material-ui/react-tabs/#automatic-scroll-buttons. How to reproduce:
What I have noticed during local debugging is that even when I force a |
Sooooooooooooo.... |
Steps to reproduce
Link to live example: https://codesandbox.io/p/sandbox/nostalgic-fog-9z6fzy
Steps:
Current behavior
When the initial
value
is the last tab of aTabs
component with ascrollable
variant the end scroll button overlaps the focused tab.react-dom
^18.0.0
usingReactDOM.createRoot
api (concurrent rendering), this happens but MUCH more intermittently. Hitting refresh on the sandbox demo page a few times will eventually make it happen.react-dom
^17.0.0
using legacyReactDOM.render
it happens every time.It seems like it is a race condition between when the scrolling happens and when the scroll buttons are rendered into the dom.
Expected behavior
The end scroll button shouldn't overlap the focused tab on initial render.
Context
I am trying to make the UX of Tabs better. It has made it awkward for users to know the tab is even focused.
Pretty confident it was introduced in 5.14.2 by either:
#36071
or
#38133
Your environment
npx @mui/envinfo
Search keywords: tabs scrollable focus
The text was updated successfully, but these errors were encountered: