Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

material-ui/reactjs menu component style is broken

enter image description here

I followed the doc from below. http://www.material-ui.com/#/components/popover

<Popover
  open={this.state.open}
  anchorEl={this.state.anchorEl}
  anchorOrigin={{horizontal: 'left', vertical: 'bottom'}}
  targetOrigin={{horizontal: 'left', vertical: 'top'}}
  onRequestClose={this.handleRequestClose}
>
  <Menu>
    <MenuItem primaryText="Sign out" onClick={this.props.logout} />
  </Menu>
</Popover>

Signout menu botton is ugly. Does anyone know why this is happening? Thanks in advance.

like image 963
jhlosin Avatar asked Dec 07 '25 03:12

jhlosin


1 Answers

This happens because <MenuItem> components renders a span with type="button" attribute, but in last versions of materialize-css there is set a rule:

[type=reset], [type=submit], button, html [type=button] {
  -webkit-appearance: button;
}

You can fix it by setting:

[type=button]{
  -webkit-appearance: none
}

In a global css file.

like image 167
Alexandr Lazarev Avatar answered Dec 08 '25 16:12

Alexandr Lazarev