No way to change underline focused color on TextInput without affecting other colors
I tried to change the cursor color in the textinput but it appears to underline, how to disable the underline? or leave it transparent?
Hello 👋, this issue has been open for more than 2 months with no activity on it. If the issue is still present in the latest version, please leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution on workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix the issue.
This issue is already open... please aprove https://github.com/callstack/react-native-paper/pull/1797 for close this
I need to hide the underline color as I will replace it with the progress bar.
Adding theme={{ colors: { primary: 'transparent' } }} will remove the underline but also the label which is not intended.
Here is my use case: https://snack.expo.io/@dcangulo/password-with-progress-bar
I need to hide the underline color as I will replace it with the progress bar.
Adding
theme={{ colors: { primary: 'transparent' } }}will remove the underline but also the label which is not intended.Here is my use case: https://snack.expo.io/@dcangulo/password-with-progress-bar
Any update?
There isn't a way to completely remove the underline? Even with a container with hidden overflow I really need vertically grouped inputs with no underline at all.
The solution from @mateusmarinho1999 works very nicely, but feels kinda hacky for me. We are chaging the primary color of the input, and what if something else now/or in future start using the primary color?
Ideally some way to specifically change the color of the underline would be better
this is fixed in https://github.com/callstack/react-native-paper/pull/1797
this is fixed in #1797
is this working?
this is fixed in #1797
is this working?
@HassanHaiderIX Yes, I'm currently using this on my code and works like a charm
this is fixed in #1797
is this working?
@HassanHaiderIX Yes, I'm currently using this on my code and works like a charm
Sorry for being naive but I dont see that PR being merged. I am not sure how can I hide underline color
this is fixed in #1797
is this working?
@HassanHaiderIX Yes, I'm currently using this on my code and works like a charm
Sorry for being naive but I dont see that PR being merged. I am not sure how can I hide underline color
sorry, I was not clear I'm using but not from the release channel, I've just implemented that PR by myself on my code
I just don't want to have the "underline", but the animated label and everything else I'd like to have. Unfortunately not every design follows 100% of Material Design. (I have never worked on a project that follow 100% of the recommendations) To whom it may concern, to "hide" the underline I followed this workaround.
const styles = StyleSheet.create({ inputContainer: { borderRadius: 4, height: 55, overflow: 'hidden', }, input: { borderRadius: 0, borderTopLeftRadius: 0, borderTopRightRadius: 0, height: 57, overflow: 'hidden', backgroundColor: '#fff', }, }; ... <View style={styles.inputContainer}> <TextInput mode="flat" label="Username" style={styles.input} /> </View>Note that Input is 2 pixels bigger than View.
I know its not answer, but it solves
I just don't want to have the "underline", but the animated label and everything else I'd like to have.
Unfortunately not every design follows 100% of Material Design. (I have never worked on a project that follow 100% of the recommendations)
To whom it may concern, to "hide" the underline I followed this workaround.
const styles = StyleSheet.create({ inputContainer: { borderRadius: 4, height: 55, overflow: 'hidden', }, input: { borderRadius: 0, borderTopLeftRadius: 0, borderTopRightRadius: 0, height: 57, overflow: 'hidden', backgroundColor: '#fff', }, }; ... <View style={styles.inputContainer}> <TextInput mode="flat" label="Username" style={styles.input} /> </View>Note that Input is 2 pixels bigger than View.
it's a bit dirty hack but made got me an idea and it might be bit better (added -2 marginBottom) this how the height is dynamic

This is way to solved this problem
- underlineColor="transparent"
<TextInput
placeholder="Write something with multilines here.."
underlineColor="transparent"
theme={{ colors: { primary: 'transparent' } }}
style={{
maxHeight: 300,
backgroundColor: 'none',
width: '100%',
}}
/>
hey @Hasintha-git the problem still persists though, if you want to add a label it won't be visible as color 'transparent' get's applied on the label as well. I can confirm the issue is still there on 4.12.0. does anybody have idea how to resolve this?
~How to change only underline color but not the cursor color in iOS?~
Found the answer
underlineColor={'transparent'}
selectionColor={'blue'}
activeUnderlineColor={'transparent'}
underlineStyle={{ display: 'none', }}
Stop being idiots answering an issue from 2018. There was no way to do this in 2018!
Try this:- <TextInput label={'Phone Number'} style={styles.phoneNumberInput} keyboardType="phone-pad" onChangeText={this.handlePhoneNumberChange} value={this.state.phoneNumber} underlineStyle={{ display: 'none', }} theme={{ colors: { primary: 'black', }, }}
And the line will be invisible.
underlineStyle={{
display: 'none',
}}
