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

[Tabs] color prop should not be available as it is ignored #43603

Open
pcorpet opened this issue Sep 4, 2024 · 1 comment
Open

[Tabs] color prop should not be available as it is ignored #43603

pcorpet opened this issue Sep 4, 2024 · 1 comment
Labels
component: tabs This is the name of the generic UI component, not the React module! status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it

Comments

@pcorpet
Copy link
Contributor

pcorpet commented Sep 4, 2024

Steps to reproduce

Link to live example

Code extract:

<Tab label="Red Item One" color="red" {...a11yProps(0)} />

Current behavior

This does not trigger any typescript alert, although the color is not used.

Expected behavior

Raise an error that "color" is not a valid prop for <Tab>

Context

I got surprised when not being able to color a Tab with a prop.

Your environment

npx @mui/envinfo
  System:
    OS: macOS 14.6.1
  Binaries:
    Node: 22.2.0 - /opt/homebrew/bin/node
    npm: 10.7.0 - /opt/homebrew/bin/npm
    pnpm: 9.3.0 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 128.0.6613.119
  npmPackages:
    @emotion/react: 11.13.3 => 11.13.3 
    @emotion/styled: 11.13.0 => 11.13.0 
    @mui/base:  5.0.0-beta.40 
    @mui/core-downloads-tracker:  5.16.7 
    @mui/lab: 5.0.0-alpha.173 => 5.0.0-alpha.173 
    @mui/material: 5.16.7 => 5.16.7 
    @mui/private-theming:  5.16.5 
    @mui/styled-engine:  5.16.4 
    @mui/system:  5.16.5 
    @mui/types:  7.2.15 
    @mui/utils:  5.16.6 
    @mui/x-data-grid:  7.15.0 
    @mui/x-data-grid-premium: 7.15.0 => 7.15.0 
    @mui/x-data-grid-pro:  7.15.0 
    @mui/x-date-pickers: 7.15.0 => 7.15.0 
    @mui/x-internals:  7.15.0 
    @mui/x-license:  7.15.0 
    @types/react: 18.3.5 => 18.3.5 
    react: 18.3.1 => 18.3.1 
    react-dom: 18.3.1 => 18.3.1 
    typescript: 5.5.4 => 5.5.4 

Search keywords: Tab, color

@pcorpet pcorpet added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 4, 2024
@pcorpet pcorpet changed the title [Tabs] color pro should not be available as it is ignored [Tabs] color prop should not be available as it is ignored Sep 4, 2024
@mnajdova
Copy link
Member

mnajdova commented Sep 4, 2024

The color is a valid HTML attribute, this is why TS is not complaining. We need to accept all valid HTML attributes, otherwise, developers will not be able to add any additional props on the element.

@mnajdova mnajdova added component: tabs This is the name of the generic UI component, not the React module! status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tabs This is the name of the generic UI component, not the React module! status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it
Projects
None yet
Development

No branches or pull requests

2 participants