question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

change autocomplete textbox background color.

See original GitHub issue

Hi @l-urence I have used autocomplete input and my code looks like this

<Autocomplete
                    autoCapitalize="none"
                    autoCorrect={false}
                    containerStyle={{zIndex:5}}
                    inputContainerStyle={{borderColor:'transparent',height: 50,backgroundColor:'red'}}
                    data={countryList.length === 1 && comp(this.state.countryQuery, countryList[0].name) ? [] : countryList}
                    defaultValue={this.state.countryQuery}
                    onChangeText={text => this.setState({countryQuery: text })}
                    placeholder="Search for your country."
                    renderItem={data => (
                      <TouchableOpacity onPress={() => this.onCountrySelection(data)}>
                        <Text style={styles.itemText}>
                          {data.name}
                        </Text>
                      </TouchableOpacity>
                    )}
                    />

I need is to change the background color to transparent so that it will look good with my design.

i tried using background color in both containerStyle and inputContainerStyle but nothing works…

if use style={{backgroundColor:'#ececec '}} then it works for android not in iOS…

any workaround idea to get this done.

Thanks in advance.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mrlaessigcommented, Feb 7, 2017

If you want to get rid of the border set it’s width to zero: inputContainerStyle={{ borderWidth: 0 }}.

1reaction
mrlaessigcommented, Feb 7, 2017

Try to use backgroundColor: 'rgba(52, 52, 52, 0)' instead of borderColor: 'transparent'.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Removing input background colour for Chrome autocomplete?
On a form I'm working on, Chrome is auto-filling the email and password fields. This is fine, however, Chrome changes the background colour...
Read more >
Change Autocomplete Styles in WebKit Browsers - CSS-Tricks
The default styling only affects the background color, but most other properties apply here, such as border and font-size .
Read more >
A trick to change the autocomplete background-color
A trick to change the autocomplete background-color. #design #css #webkit. Story. When I worked on a project as ...
Read more >
autofill - CSS: Cascading Style Sheets - MDN Web Docs
This means that you cannot set the background-color , background-image , or color in your own rules. Syntax. :autofill. Examples. The following ...
Read more >
Removing input background color for Chrome autocomplete
Removing input background color for Chrome autocomplete · GitHub. Instantly share code, notes, and snippets.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found