withStyle Selected tab doesn't work
See original GitHub issueI follow the example to customize the tab text color when its selected, unfortunately, it seems doesn’t work at all. When tab is selected, the color didn’t change to blue.
any ideas?
"@material-ui/core": "^3.8.3",
"typescript": "^3.2.2"
import * as React from "react";
import {Tab} from '@material-ui/core';
import {MuiThemeProvider, createMuiTheme} from '@material-ui/core/styles';
import withStyles, { StyleRulesCallback, WithStyles } from '@material-ui/core/styles/withStyles';
const styles: StyleRulesCallback = theme => ({
tabRoot: {
color: "#bdc0c4",
'&:hover': {
color: '#ffffff',
opacity: 1,
},
'&$tabSelected': {
color: '#1890ff',
fontWeight: theme.typography.fontWeightMedium,
},
textTransform: 'initial',
},
tabSelected: {
color: '#1890ff'
}
});
class NavBarItemsComponent extends React.Component<WithStyles<string> & Props> {
public render(): React.ReactNode {
const { classes } = this.props;
const tabStyle = { root: classes.tabRoot, selected: classes.tabSelected };
return (
<Tab label={this.props.label} classes={tabStyle}/>
)}
};
export default withStyles(styles)(NavBarItemsComponent);
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
withStyle Selected tab doesn't work · Issue #14184 - GitHub
It seems only selected doesn't work, hover works fine. UPDATE I applied customized tab to the project, and got such error message in...
Read more >How can I override the selected style for a tab? - Stack Overflow
I could come up with a solution using overriding CSS using withStyles, <Tabs value={value} onChange={this.
Read more >Fixed issues in InDesign - Adobe Support
InDesign becomes unresponsive while exporting a specific document to PDF. Panels are not loaded properly in custom workspace. Unable to copy and ...
Read more >Swap style and component libraries – Figma Help Center
If a matching style or component isn't found in your selected library, Figma won't swap those assets. They'll stay connected to the original...
Read more >Copy and paste text styles in Pages on Mac - Apple Support
In Pages on your Mac, copy just the style of selected text, then apply that style to ... If the document where you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Oh, I see that the documentation example isn’t using this pattern. What do you think of updating it? It’s cleaner but requires more knowledge of how it works.
@oliviertassinari - Thanks for the sample code. It works!