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

Select - can't set background color #458

Closed
giladaya opened this issue Aug 13, 2018 · 4 comments
Closed

Select - can't set background color #458

giladaya opened this issue Aug 13, 2018 · 4 comments
Labels

Comments

@giladaya
Copy link

I tried this in the docs (https://jxnblk.com/rebass/components/Select):

<Select bg="red" css={{backgroundColor: 'blue'}}>
  <option>Hello</option>
  <option>Beep</option>
  <option>Boop</option>
</Select>

The background color doesn't change at all.

My workaround (in my code) was to define a styled component with a custom background color and use that:

const MySelect = styled(Select)`
    background-color: red;
`
@jxnblk
Copy link
Member

jxnblk commented Aug 13, 2018

In your example you have both a bg prop and backgroundColor defined. What is the expected behavior here?

@giladaya
Copy link
Author

Actually I smooshed together two separate examples, both demonstrating that setting the background on a Select component doesn't work:

Example 1:

<Select bg="red">
  <option>Hello</option>
  <option>Beep</option>
</Select>

Expected behaviour: the background color of the Select component should be red

After Example 1 didn't work, I tried a different approach:
Example 2:

<Select css={{backgroundColor: 'blue'}}>
  <option>Hello</option>
  <option>Beep</option>
</Select>

Expected behaviour: the background color of the Select component should be blue

Example 2 didn't work either.

@jxnblk
Copy link
Member

jxnblk commented Aug 14, 2018

Thanks! Yeah that's definitely a bug – looks like this line should be backgroundImage not background https://github.com/jxnblk/rebass/blob/master/src/Select.js#L26

@jxnblk
Copy link
Member

jxnblk commented Sep 8, 2018

Should be fixed in v2.3.0

@jxnblk jxnblk closed this as completed Sep 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants