TextInput outlined mode: label has unknown shadow
See original GitHub issueCurrent behaviour
Please see attached:
Expected behaviour
There should not be any weird shadow.
Code sample
Here’s what I’m using to render this input field:
<TextInput
label='Name'
testID="input"
mode="outlined"
theme={{ colors: { placeholder: 'grey', background: '#f5f6f5', text: 'grey', primary: '#5d5d5d' }}}
style={styles.input}
value={ this.state.name === undefined ? name : this.state.name }
onChangeText={name => this.setState({ name })}
/>
and here’s the parent config:
const theme = {
...DefaultTheme,
colors: {
...DefaultTheme.colors,
text: '#565656',
disabled: '#ffffff',
primary: '#3f51b5'
},
fonts: {
regular: "AirbnbCereal"+fontSuffix+"-Book",
medium: "AirbnbCereal"+fontSuffix+"-Medium",
bold: "AirbnbCereal"+fontSuffix+"-Bold"
}
}
Screenshots (if applicable)
What have you tried
Your Environment
software | version |
---|---|
ios or android | android |
react-native | 0.57.3 |
react-native-paper | 2.2.4 |
node | 8.9 |
npm or yarn | yarn |
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:23 (2 by maintainers)
Top Results From Across the Web
Input text label on border in react native - Stack Overflow
The trick was to put the Text in a View with a background color the same as the screen's and position the Text...
Read more >TextInput · React Native Paper
A component to allow users to input text. ... In outlined mode, the background color of the label is derived from colors?.background in...
Read more >accent-color - CSS: Cascading Style Sheets - MDN Web Docs
The accent-color CSS property sets the accent color for user-interface controls generated by some elements.
Read more >Cheat Sheet - Emmet Documentation
All unknown abbreviations will be transformed to tag, ... input:text, input:t ... You can prefix abbreviations with hyphen to produce vendor-prefixed ...
Read more >Input text box shadow - CodePen
Html and css input text box shadow on hover and focus Forked from [Mohammed Moustafa](http://codepen.io/Mohammed_Moustafa/)'s Pen [Input text box shad...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is happening because there are TWO labels on top of each other. One of them has color of background.
But it doesn’t work on android because even if your background is white and color text is white, you will still see the text.
The second label is used to “cut” the border. I recommend to calculate the width of background from label, not just insert it with background color.
In 3.0 branch (current master) it should not be a problem anymore.