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

A lot of tabs shows scrollbar and crashes the application #1689

Closed
tkvw opened this issue Mar 22, 2018 · 12 comments · Fixed by #4538 · May be fixed by #5713
Closed

A lot of tabs shows scrollbar and crashes the application #1689

tkvw opened this issue Mar 22, 2018 · 12 comments · Fixed by #4538 · May be fixed by #5713

Comments

@tkvw
Copy link
Contributor

tkvw commented Mar 22, 2018

Example app: https://pp0o4x40p0.codesandbox.io/#/posts/13

I just copied the last tab a couple of times and you'll see a scrollbar at the bottom.
What I expected: that the Tabs component would be scrollable and the application not to crash.
I think this is because the Tabs parent width is implicit instead of explicit.
2018-03-22_09-51-42

@fzaninotto
Copy link
Member

I believe it's a material-ui bug.

@tkvw
Copy link
Contributor Author

tkvw commented Mar 22, 2018

So I believe it's because the clientWidth can't be calculated correctly. This can be fixed by adding minWidth:0 on the content class of the Layout component.

@oliviertassinari
Copy link
Contributor

@tkvw Would you mind sharing the link to your codesandbox reproducing the issue? I couldn't do better than https://codesandbox.io/s/k3wpror8yv.

@fzaninotto
Copy link
Member

@tkvw so is it a material-ui bug, or a react-admin bug?

@tkvw
Copy link
Contributor Author

tkvw commented Mar 31, 2018

I think react-admin, what I've debugged is that the tabs container needs a fixed width container. Setting minWidth accomplishes this.

@fzaninotto fzaninotto self-assigned this Apr 4, 2018
@fzaninotto fzaninotto added the bug label Apr 4, 2018
fzaninotto added a commit that referenced this issue Apr 4, 2018
@fzaninotto
Copy link
Member

Fixed by #1721

@fzaninotto
Copy link
Member

#1721 needs to be reverted, Im reopening this one.

@fzaninotto fzaninotto reopened this May 9, 2018
@fzaninotto fzaninotto removed their assignment May 9, 2018
@MROFerreiro
Copy link

MROFerreiro commented Feb 15, 2019

I think is a materia-ui bug however I could fixed it by setting the classes passed to <TabbedShowLayoutTabs> with a {width: 0}. Defined a styles object like:

const styles = {
  tabs: {
    width: 0
  }
}

Used with with my Show resource component:

export ResourceShow = withStyles(styles)(ResourceShowView);

And in my view added that class to <TabbedShowLayoutTabs>:

import { Show, TabbedShowLayout, TabbedShowLayoutTabs } from 'react-admin'

const ResourceShowView = ({ classes, ...props}) => (
  <Show {...props} >
    <TabbedShowLayout tabs={<TabbedShowLayoutTabs classes={{scrollable: classes.tabs}} scrollable scrollButtons={'on'}/>}>
      {<YourTabs/>}
    </TabbedShowLayout>
  </Show>
)

I don't know why this happens, but it worked! 😃

PS: Don't know nothing about crashing 😢

@Kmaschta
Copy link
Contributor

Kmaschta commented Oct 9, 2019

I reproduced with the latest versions (v2 + v3) and the bug is still there.
Still, the app doesn't crash.

@fzaninotto
Copy link
Member

#4538 breaks FormTabs, we have to revert it in #5132. Therefore, we keep this issue open.

@akku750156
Copy link

@tkvw can you assign me this issue, if anyone is not working on it for now ?

@WiXSL WiXSL added the v3 label Nov 2, 2022
@djhi
Copy link
Contributor

djhi commented Jan 9, 2023

No news for some time, closing

@djhi djhi closed this as not planned Won't fix, can't repro, duplicate, stale Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants