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.

Weird UI behavior of Text Input with Dark Mode

See original GitHub issue

Current behaviour

With Dark Mode on, some Text Input outlined are ok, others with same code have a white line on the label. photo5879971770990180747 photo5879971770990180746

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:open
  • Created 2 years ago
  • Reactions:1
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sunnycreaturecommented, Apr 11, 2022

@gsbelarus could you please try to reproduce it on the expo snack?

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.

image

image

BTW, could it be because of this style:

https://github.com/callstack/react-native-paper/blob/62996571bd2fa7c850f5e70ab8cfd79c6e02bf1d/src/components/TextInput/Label/LabelBackground.tsx#L91

1reaction
lukewalczakcommented, Apr 11, 2022

@gsbelarus could you please try to reproduce it on the expo snack?

Read more comments on GitHub >

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

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