Description
- This is not a v0.x issue.
- I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior 🤔
Tabs should render in a certain style/layout, depending on the width of the Tabs
(container), instead of depending on the width of the screen.
Current Behavior 😯
Tabs base their width on the screen, and not on the tabs container.
<div style={{ width: 350, border: '1px solid red' }}>
<Tabs variant="fullWidth" scrollButtons="auto">
<Tab label="Tab 1" />
<Tab label="Tab 2" />
<Tab label="Tab 3" />
<Tab label="Tab 4" />
</Tabs>
</div>
Steps to Reproduce 🕹
Link present: https://x87uz.codesandbox.io/
Link editor: https://codesandbox.io/embed/materialuitabs-x87uz
- Open the preview screen
- Notice that only
TAB 1
andTAB 2
are visible - Open devtools, responsive mode
- Scale screen to 350 px
- Notice that
TAB 1
,TAB 2
,TAB 3
andTAB 4
are visible.
The tab container is in both cases, 350 px wide.
Context 🔦
Tabs should render the same based on the width of the tab container. Material is often used and optimized for mobile layouts. This case confirms it.
What I'm doing, is rendering multi-column layout on desktop, and on mobile this translates to multiple single-column screens. So on desktop you would see column 1 + 2, while on mobile you see 1 or 2.
Thereby, my tabs are rendered in a single column, and on desktop optimized for a fixed width. While they scale to fullWidth on mobile.
Your Environment 🌎
Tech | Version |
---|---|
Material-UI | v3.9.3 |
React | v16.8.2 |
Browser | Chrome 74 |