Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DropDownMenu default label style not consistent? #2604

Closed
vmaudgalya opened this issue Dec 20, 2015 · 1 comment
Closed

DropDownMenu default label style not consistent? #2604

vmaudgalya opened this issue Dec 20, 2015 · 1 comment
Labels
bug 🐛 Something doesn't work

Comments

@vmaudgalya
Copy link
Contributor

Hi, I've found that when I insert a DropDownMenu in different locations in my code, the default label style is not consistent.

Here is some code where I see an inconsistency:

import React from 'react'
import { RaisedButton, TextField, DropDownMenu } from 'material-ui'
import injectTapEventPlugin from 'react-tap-event-plugin'
injectTapEventPlugin()

const Details = React.createClass({

  _handleItemSubmit() {
    console.log('submitted item');
  },

  render() {
    let options = [
       { payload: '1', text: 'First' },
       { payload: '2', text: 'Second' }
    ]

    return (
      <div>
        <TextField
          hintText="Class"
          floatingLabelText="Class" />
        <DropDownMenu menuItems={options}/>
        <RaisedButton label="Submit" primary={true} onClick={this._handleItemSubmit}/>
      </div>
    )
  }

})

export default Details

And here is how it appears:

When closed:
screen shot 2015-12-20 at 12 16 08 am

When open:
screen shot 2015-12-20 at 12 16 13 am

Sometimes this issue is there, and sometimes it is not. At first I thought it was because some other styling was overwriting the DropDownMenu's style props but after removing all other styling, it seems like this certainly may be an issue.

Adding this as a property to the DropDownMenu seems to fix this issue.

labelStyle={{fontFamily: 'Roboto, sans-serif'}}

I've looked through the updates to this file and it seems like labelStyle might be deprecated soon.
How can this be fixed? Should it be, if it will be deprecated soon? I wouldn't mind making the PR myself! 😋

@oliviertassinari
Copy link
Member

That looks like a bug.
I think that the font family should be applied to the root element.
It should be something like /~https://github.com/callemall/material-ui/blob/master/src/tabs/tab.jsx#L110.
A PR is welcomed 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work
Projects
None yet
Development

No branches or pull requests

2 participants