3

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.

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

5 Comments

In React Material UI, components have inline style, so don't forget !important in the css file.
Actually, I didn't see that property to be overridden by inline styles. But it may be.
does this mean I need materialize css/js to be imported when I use MaterialUI? I tried to add it but it broke all the structure... guess it conflict with other css files.
Those styles are imported by default, all you have to do, is to override this rule in your own global css file.
Note that the descriptor will need to be at least as specific as the one in normalize.css, which is html [type=button]. I used exactly that in my css file, which works because I have my styles after normalize in my html. If your styles are first, you'll need to be more specific still.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.