-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
[Tabs] Change tab height #5391
Comments
Yes, just use the |
@lucasbento I read the documentation but I couldn't get it to work. Do I use the |
@ankitgoyal100: sorry, I read wrong and thought you questioned about |
@lucasbento no problem. I passed in |
@ankitgoyal100: it works with |
@lucasbento this is what happens when I set the height in the |
@ankitgoyal100: Can you please reproduce that issue on a bin? |
I encountered the same issue where both 'Tab' (NOT 'Tabs') properties 'className' and 'style' do NOT seem to be applied to the root element. In my case, I am trying to use Here is the whole relevant code: |
It looks like there is some misunderstanding on what the root element of 'Tab' refers to. By inspecting the dom tree in browser, I found that the root element of 'Tab' is the tab button. I think both ankitgoyal100 and I confused the 'Tab' root element with the 'Tab' panel itself. The 'Tab' panel is actually a child inside the content container. If my understanding is correct now, then there does not seem to be an API for setting the style of the root of each 'Tab' panel. |
An initial migration of the |
If you change the source code directly, you can edit the height. But I don't know how you can edit the style, so we'll have to wait for the next release. Also if you do this, it changes all of the tabs |
@jr69 You should be able to use the |
@oliviertassinari Is this in the stable release or the upcoming one? Also I tried changing size in the style for the element, but nothing happened. So my hacky work around by editing the source code works fine for me, albeit limited since I can't have more than one different styling of a tab |
@jr69 That should be true with whatever version you are using. If you can't, that should be considered a bug. |
@oliviertassinari Either I implemented it wrong, or its not working. If you go to http://www.material-ui.com/#/components/tabs and scroll down, every property with 'style' in it, I literally assigned all with an inline style of {{height: '16px'}}, and the text didn't change. I looked the console, and noticed that the text in the tab itself was in a span, that was below the 'tab' div itself (that element was the one that got the changed height). |
Same issue - looking at the code for Tab it appears the Button component has a height assigned but no way to update the style. |
Happy to see it's not just me having this issue. Bleeping stupid ... It's assigned a hard-coded value of 48px in Tab.js with no way to override.
|
It is possible to specify the height using the |
@AliceR This works! |
Maybe somebody will be interested in my way of solving the height problem with the latest version (v4.0.0-beta.2). In my situation I had to minimize the height of the tab. @AliceR's solution, to change it using the So I set Then one can change the |
@petrcherni https://codesandbox.io/s/material-demo-49ycq const StyledTab = withStyles({
root: {
minHeight: "auto",
padding: 0
}
})(Tab); |
WORKS
|
appliance of above example...
|
Was having this problem too. With the help above it seems like setting minHeight is the key here <Tab sx={{ minHeight: '36px', height: '36px' }} /> |
Thanks for starting this thread ankitgoyal100 hope you are currently making billions more than the ass who responded to you like that |
This totally worked for me thx man, easiest fix, long time to find it. |
Thank you! I also had to set the same sx props for the Tabs element too, but was customising with state classes |
Is there a way to change the tab height so it is not 48px tall?
The text was updated successfully, but these errors were encountered: