mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.96k stars 32.27k forks source link

[material-ui][Tabs] Selected class not being passed #42501

Closed MylesWardell closed 5 months ago

MylesWardell commented 5 months ago

Steps to reproduce

Link to live example: (required)

Steps:

  1. Create Theme
  2. Add style for selected on MuiTab
  3. Selected does not work

Current behavior

No styles are showing up

Expected behavior

Selected should style the selected mui tab

Context

Creating a muiTheme using createTheme

In the override resolver function selected is not being passed through to it, I don't maintain or write for Mui but at cursory glance it should be removed or if this is intended removed from typescipt intlsense. image

This file is here https://github.com/mui/material-ui/blob/next/packages/mui-material/src/Tab/Tab.js

If this is an issue maybe make it so override controller must return the types in the createTheme?

Your environment

npx @mui/envinfo ``` Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here. ```

Search keywords: Mui-selected, createTheme

MylesWardell commented 5 months ago

My env trying to style the selected text in createTheme. This does not work

image

This does style the selected tab

image

brijeshb42 commented 5 months ago

Mui-selected class gets applied on the actually selected TabItem and not the TabRoot. Not sure what your specific requirement is about styling the root when an item is selected, but the selected style will always get applied because one or other tab item is always selected. It'll also be helpful if you had a codesandbox.

github-actions[bot] commented 5 months ago

Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.