RaisedButton fullWith在v0.15中不再展开

时间:2016-05-10 09:34:13

标签: material-ui

RaisedButtons组件在材料-ui的v0.15版本中不再出现fullWidth,这在v0.15-beta中有效。我通过向元素添加minWidth: '100%'来解决它。这是故意还是我在这里做错了什么?

const buttonStyle = {
  minWidth:'100%',//<- works with minWidth set
};
return (
  <MuiThemeProvider muiTheme={muiTheme}>
    <div style={style}>
      <SelectField max-height={200} style={selectStyle} fullWidth={true} onChange={this.onFondsSelect} value={displayValue} id="fonds-selection">
        {this.menuItems}
      </SelectField>
      <RaisedButton style={buttonStyle} onClick={this::this.startClick} fullWidth={true}>Button 1</RaisedButton><br/>
      <RaisedButton style={buttonStyle} onClick={this.resetStart} fullWidth={1}>BUtton 2</RaisedButton>
    </div>
  </MuiThemeProvider>
  );

1 个答案:

答案 0 :(得分:1)

这个错误是在材料-ui v15中引入的 issue =&gt; github.com/callemall/material-ui/issues/4226

但是正如您在问题评论中看到的那样,可能会在v16中弃用fullWidth以支持样式对象。所以你正在以正确的方式做到这一点。