material-ui

Change InputLabel color of a Select component when clicked/focused

混江龙づ霸主 提交于 2019-12-11 05:18:26
问题 If you look at the components here: https://material-ui.com/components/selects/, you'll see that when clicked, the label moves up and minimizes but also changes color (along with the border / line at the bottom that defines the text). I figured out how to change all the colors EXCEPT the text that minimizes when clicked or focused. If someone can please help me. It's driving me nuts Bonus Points if you can explain how you got to this conclusion so I can learn how to do this myself as well.

Should I wait for material-ui v1 or can I use the pre-release now?

烈酒焚心 提交于 2019-12-11 05:14:11
问题 Building a React.js dashboard (data tables + graphs) and styling this using material-ui. If I use the pre-release version right now, will I have make more changes when the v1 of material-ui is released? 回答1: I'd recommend migrating as soon as you can. It is not trivial, but you pay that price once to use the new features (like the new approach to style, CSS API, built in grid system/breakpoints, etc). Any changes made to v1 should be easier to deal with as releases roll out. Generally, the

React to render dynamically a certain number of components

 ̄綄美尐妖づ 提交于 2019-12-11 05:09:44
问题 I would like to display a number of the component Star (material-ui component) based on the number of points the user has earned (this.state.points). I don't know how to do this. import React, { Component } from "react"; import { Star } from "@material-ui/icons"; Points extends Component { constructor(props) { super(props); this.state = { points: 6 }; } render() { return ( <div> <p> + {this.state.points} points <Star /> </p> </div> ); } } export default Points; 回答1: You can use Array.fill to

Migration to Material-ui V4

回眸只為那壹抹淺笑 提交于 2019-12-11 05:04:08
问题 When I go to migrate material-ui from version 3.9.3 to version 4.3.2 in my React Application, I get an error like TypeError: styles_1.createGenerateClassName is not a function . I'm completely confused on how to migrate to Material UI V4. What are the necessary packages I need with the correct version? If any one has worked on this kind of scenario, please help me. Thanks. This is my package.json file: "dependencies": { "react": "^16.8.6", "react-dom": "^16.8.6", "@date-io/moment": "^1.3.1",

React material-ui MenuItem containerElement not working

岁酱吖の 提交于 2019-12-11 04:27:17
问题 I have following code: <MenuItem primaryText="home" containerElement={<Link to="/" />} /> But it doesn't work as explained in other topics/threads where MenuItem discussed like here Material UI Menu using routes. Once i add containerElement prop to MenuItem i'm getting this exception: Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it

Align typography component to the right

笑着哭i 提交于 2019-12-11 03:19:45
问题 I would like to align two typography components on the same line so that one is aligned to the left and the other to the right. How do I achieve this? This is the code I have but the components are aligned next to each other to the left. const useStyles = makeStyles({ leftText: { textAlign: "left" }, rightText: { textAlign: "right" } }); function ChooseNewSupport(props) { const classes = useStyles(); return ( <DialogContent> <Typography inline variant="body1" className={classes.leftText}>

React Material-UI menu anchor broken by react-window list

可紊 提交于 2019-12-11 02:49:46
问题 I am using Material-UI and react-window in a project. My issue is, the material-ui menu component does not anchor to the element provided when that element is within a react-window virtualized list. The menu will appear in the upper left corner of the screen instead of anchored to the button that opens it. When using it all in a non-virtualized list, it works as expected. The menu properly anchors to the button that opens it. Here's an example sandbox. The sandbox is pretty specific to how I

Material-UI drop-down menu causing error in IE11 after updating to angular 8

冷暖自知 提交于 2019-12-11 02:32:08
问题 Angular 8 application with material 8 throws following error on IE11 when the material menu is opened: Unable to get property 'opacity' of undefined or null reference It worked well with angular 7.2. Used IE11 Version: 11.1146.16299.0 Update version: 11.0.125 New project dependency versions: "dependencies": { "@angular/animations": "^8.0.0", "@angular/cdk": "^8.0.0", "@angular/common": "~8.0.0", "@angular/compiler": "~8.0.0", "@angular/core": "~8.0.0", "@angular/forms": "~8.0.0", "@angular

How to install Material-UI Docs WITHOUT installing material-ui?

可紊 提交于 2019-12-11 01:50:42
问题 currently to install and run material-ui docs locally, it requires two npm install , one within material-ui, another within material-ui/docs. cd <project folder>/material-ui npm install cd <project folder>/material-ui/docs npm install But I want to use the docs site as a starting point to create my own app. How can I install the docs without installing the whole material-ui? I've tried adding "material-ui": "^0.14.4", , and ALL dependencies in material-ui/package.json to the material-ui/docs

MuiThemeProvider: How to use different themes for different routes?

随声附和 提交于 2019-12-11 01:47:41
问题 I need to slightly change the theme depending on the current section of the site. It seems that MuiThemeProvider only sets muiTheme on load; but it needs to be updated when the props change. How can this be done? 回答1: You can try to put the theme in a wrapping component that keeps the theme in it's state. Using React's context this component exposes a function to child components to change the state. import React, { Component } from 'react'; import MuiThemeProvider from 'material-ui/styles