Skip to content

[Tabs] Remove min-width media query #15824

Closed
@smeijer

Description

@smeijer
  • 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>

material-tabs

Steps to Reproduce 🕹

Link present: https://x87uz.codesandbox.io/
Link editor: https://codesandbox.io/embed/materialuitabs-x87uz

  1. Open the preview screen
  2. Notice that only TAB 1 and TAB 2 are visible
  3. Open devtools, responsive mode
  4. Scale screen to 350 px
  5. Notice that TAB 1, TAB 2, TAB 3 and TAB 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking changecomponent: tabsThis is the name of the generic UI component, not the React module!design: materialThis is about Material Design, please involve a visual or UX designer in the processnew featureNew feature or request

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions