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.

TextInput outlined mode: label has unknown shadow

See original GitHub issue

Current behaviour

Please see attached:

screenshot 2018-11-15 at 7 01 25 pm

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:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:23 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
dakzhcommented, Jan 18, 2019

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.

2019-01-19 3 48 36

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.

0reactions
jbindacommented, Jul 16, 2019

In 3.0 branch (current master) it should not be a problem anymore.

Read more comments on GitHub >

github_iconTop 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 >

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