Weird UI behavior of Text Input with Dark Mode
See original GitHub issueCurrent behaviour
With Dark Mode on, some Text Input outlined are ok, others with same code have a white line on the label.
The code is the same for “Nome Garage*” and “Email”:
<TextInput
label="Nome Garage*"
mode={'outlined'}
value={garageDoc.name}
onChangeText={text => setGarageDoc({...garageDoc, name: text})}
/>
<TextInput
label="Email"
value={garageDoc.email}
mode={'outlined'}
onChangeText={text => setGarageDoc({ ...garageDoc, email: text })}
/>
The started value is undefined for both, I tried to change the order, modify the style, change the label name with so many tries and I still can’t understand what is causing this behaviour.
This behaviour is shared in all part of my application where there is a Text Input oulined.
Expected behaviour
I’d expect to not have a white line on Text Input label outlined in dark mode.
Code sample
<SafeAreaView>
<ScrollView
contentInsetAdjustmentBehavior="automatic"
nestedScrollEnabled
keyboardShouldPersistTaps={'handled'}>
<Card>
<Card.Content>
<TextInput
label="Nome Garage*"
mode={'outlined'}
value={garageDoc.name}
onChangeText={text => setGarageDoc({...garageDoc, name: text})}
/>
<TextInput
label="Email"
value={garageDoc.email}
mode={'outlined'}
onChangeText={text => setGarageDoc({ ...garageDoc, email: text })}
/>
</Card.Content>
</Card>
</ScrollView>
</SafeAreaView>
What have you tried
This behaviour is all
Your Environment
software | version |
---|---|
ios or android | android |
react-native | 0…67.3 |
react-native-paper | 4.11.2 |
node | 14.x |
npm or yarn | yarn |
expo sdk | no |
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:14 (3 by maintainers)
Top Results From Across the Web
SwiftUI TextField changing color in dark mode - Stack Overflow
I have some strange behavior using SwiftUI and a TextField. In the light mode of macOS my TextField is looking the same colorwise...
Read more >Dark Input Field - Dribbble
Discover 1 Dark Input Field design on Dribbble. ... Text field UI design templates - S8 Figma UI kit active app back black...
Read more >What is Dark Mode for Email and Does it Affect Rendering?
Dark mode is a setting that shifts an interface's color palette to display content in high contrast using dark background colors and light...
Read more >PySimpleGUI
import PySimpleGUI as sg sg.theme('Dark Grey 13') layout = [[sg.Text('Filename')], [sg.Input(), sg.FileBrowse()], [sg.OK(), sg.Cancel()]] window = sg.
Read more >How To Fix Outlook Dark Mode Problems (Email Design)
This tutorial will show you how to fix some of Microsoft Outlook's worst behavior when it comes to text color in Dark Mode....
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 on behalf of @gsbelarus. we can’t reproduce as the dark mode couldn’t be set for the screen in question within expo snack.
But we observe that this bug is present only for short labels. When label has 10-12 characters or longer everything works fine.
BTW, could it be because of this style:
https://github.com/callstack/react-native-paper/blob/62996571bd2fa7c850f5e70ab8cfd79c6e02bf1d/src/components/TextInput/Label/LabelBackground.tsx#L91
@gsbelarus could you please try to reproduce it on the expo snack?