material-ui

Material UI Multi-Select different code value and visible value - show keys instead values

你离开我真会死。 提交于 2020-01-15 09:03:30
问题 I am using Material UI Multiple Select based on documentation example. I need to save id of the selected option and show name, so I render object. When I used example from documentation with placeholder, i see ids instead names of selected. See: https://codesandbox.io/s/kxz5yqmrzv?from-embed const names = [ { id: "a", name: "Oliver Hansen" }, { id: "b", name: "Van Henry" }, { id: "c", name: "April Tucker" }, { id: "d", name: "Ralph Hubbard" }, { id: "e", name: "Omar Alexander" }, { id: "f",

Material UI Multi-Select different code value and visible value - show keys instead values

偶尔善良 提交于 2020-01-15 09:01:55
问题 I am using Material UI Multiple Select based on documentation example. I need to save id of the selected option and show name, so I render object. When I used example from documentation with placeholder, i see ids instead names of selected. See: https://codesandbox.io/s/kxz5yqmrzv?from-embed const names = [ { id: "a", name: "Oliver Hansen" }, { id: "b", name: "Van Henry" }, { id: "c", name: "April Tucker" }, { id: "d", name: "Ralph Hubbard" }, { id: "e", name: "Omar Alexander" }, { id: "f",

CardMedia height material-ui

喜欢而已 提交于 2020-01-15 06:18:04
问题 Im struggling trying to change the height of the image inside the CardMedia Im setting the style with const style = { height: 32, }; and using it in <CardMedia overlay={<CardTitle title="Title"/>} mediaStyle={style}> <img src="imgUrl" /> </CardMedia> but the height of the image remains the same. The only thing that happens is that the overlay with the title moves to the top. I've tried all the CardMedia properties but i havent succeeded 回答1: You need to apply the styles on the image directly:

CardMedia height material-ui

≡放荡痞女 提交于 2020-01-15 06:17:08
问题 Im struggling trying to change the height of the image inside the CardMedia Im setting the style with const style = { height: 32, }; and using it in <CardMedia overlay={<CardTitle title="Title"/>} mediaStyle={style}> <img src="imgUrl" /> </CardMedia> but the height of the image remains the same. The only thing that happens is that the overlay with the title moves to the top. I've tried all the CardMedia properties but i havent succeeded 回答1: You need to apply the styles on the image directly:

CardMedia height material-ui

孤者浪人 提交于 2020-01-15 06:17:00
问题 Im struggling trying to change the height of the image inside the CardMedia Im setting the style with const style = { height: 32, }; and using it in <CardMedia overlay={<CardTitle title="Title"/>} mediaStyle={style}> <img src="imgUrl" /> </CardMedia> but the height of the image remains the same. The only thing that happens is that the overlay with the title moves to the top. I've tried all the CardMedia properties but i havent succeeded 回答1: You need to apply the styles on the image directly:

Typography component

血红的双手。 提交于 2020-01-15 05:46:12
问题 According to the material ui docs here: https://material-ui.com/components/typography/ I should be able to use the Typography component as follows: <Typography variant="h1" component="h1"> Hello World </Typography> However, since updating to nextjs 9, I get this typing error: Type 'string' is not assignable to type 'ElementType<HTMLAttributes<HTMLElement>>' for the component property. I've tried updating the typing dependencies a bunch, but nothing seems to help. Thanks to Shanon's suggestion

RadioButtonGroup within nested List

你说的曾经没有我的故事 提交于 2020-01-15 04:27:06
问题 I'm using Material-UI and I'd like to use the List/ListItem Component to group my Radio Buttons. Similar to this one: <RadioButtonGroup ...> <List> <ListItem ... nestedItems={[ <RadioButton ... />, <RadioButton ... /> ]} /> <ListItem ... nestedItems={[ <RadioButton ... />, <RadioButton ... /> ]} /> </List> </RadioButtonGroup> Is there a way to archive this? Thanks. 回答1: My temporary workaround is to use checkboxes which look and behave like radio buttons. import List from 'material-ui/lib

How does one programmatically 'open' a Material-UI Select field?

五迷三道 提交于 2020-01-14 07:05:28
问题 The select field can be found here: in the Material-UI demo It's methods appear to be inherited from the menu / popover classes but I haven't been able to figure out how to fire 'open' when onFocus event fires for example. This would solve my keyboard related usability issues! 回答1: You could do it by accessing the DOM node of the down arrow button, and manually triggering a click event on it. Example that works on Mac Chrome on the demo website, via the console, after adding a 'mySelect' id

TypeError: Cannot read property 'prepareStyles' of undefined

允我心安 提交于 2020-01-13 07:39:06
问题 My Component looks like import React, {PropTypes} from 'react'; import TransactionListRow from './TransactionListRow'; import {Table, TableBody, TableHeader, TableHeaderColumn, TableRow} from 'material-ui/Table'; const TransactionList = ({transactions}) => { return ( <Table> <TableHeader displaySelectAll={false}> <TableRow> <TableHeaderColumn>Name</TableHeaderColumn> <TableHeaderColumn>Amount</TableHeaderColumn> <TableHeaderColumn>Transaction</TableHeaderColumn> <TableHeaderColumn>Category<

How to make a 'Select' component as required in Material UI (React JS)

别说谁变了你拦得住时间么 提交于 2020-01-12 07:32:07
问题 I want to display like an error with red color unless there is a selected option. Is there any way to do it. 回答1: For setting a required Select field with Material UI, you can do: class SimpleSelect extends React.Component { state = { selected: null, hasError: false }; handleChange(value) { this.setState({ selected: value }); } handleClick() { this.setState({ hasError: false }); if (!this.state.selected) { this.setState({ hasError: true }); } } render() { const { classes } = this.props; const