react-native-paper icon indicating copy to clipboard operation
react-native-paper copied to clipboard

Weird UI behavior of Text Input with Dark Mode

Open francesco-clementi-92 opened this issue 2 years ago • 14 comments

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

francesco-clementi-92 avatar Mar 17 '22 06:03 francesco-clementi-92

Hey! Thanks for opening the issue. The issue doesn't seem to contain a link to a repro (a snack.expo.dev link or link to a GitHub repo under your username).

Can you provide a minimal repro which demonstrates the issue? A repro will help us debug the issue faster. Please try to keep the repro as small as possible and make sure that we can run it without additional setup.

github-actions[bot] avatar Mar 17 '22 06:03 github-actions[bot]

Couldn't find version numbers for the following packages in the issue:

  • react-native
  • react-native-vector-icons
  • npm
  • yarn
  • expo

Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.

github-actions[bot] avatar Mar 17 '22 06:03 github-actions[bot]

Hello @francesco-clementi-92 could you please try to reproduce it on expo snack?

lukewalczak avatar Mar 28 '22 17:03 lukewalczak

Hi Luca,

Already tried on expo, but can't find a way to reproduce it. I'll try without it

Il lun 28 mar 2022, 19:48 Luke Walczak @.***> ha scritto:

Hello @francesco-clementi-92 https://github.com/francesco-clementi-92 could you please try to reproduce it on expo snack http://snack.expo.dev

— Reply to this email directly, view it on GitHub https://github.com/callstack/react-native-paper/issues/3122#issuecomment-1080960068, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHHCV3SVRFA5XOK36CLL3JTVCHWGRANCNFSM5Q6AUXKQ . You are receiving this because you were mentioned.Message ID: @.***>

francesco-clementi-92 avatar Mar 28 '22 17:03 francesco-clementi-92

Same issue

celciusjj avatar Apr 04 '22 18:04 celciusjj

@celciusjj did you find a way to replicate the issue?

francesco-clementi-92 avatar Apr 05 '22 07:04 francesco-clementi-92

@celciusjj did you find a way to replicate the issue?

The application is being tested on other cell phones from another country, and it is a darkmode error in the latest version of react native paper. but I myself could not replicate it on my cell phone.

What I did for now was remove the dark mode in my application

0F594A7D-7F45-41B7-A942-5D373D45B3C8

celciusjj avatar Apr 06 '22 02:04 celciusjj

Share your theme object

raajnadar avatar Apr 06 '22 06:04 raajnadar

We have encountered the same problem.

gsbelarus avatar Apr 11 '22 11:04 gsbelarus

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

lukewalczak avatar Apr 11 '22 11:04 lukewalczak

@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

sunnycreature avatar Apr 11 '22 13:04 sunnycreature

Please try to use that snack where you can switch between themes and add your specific code for reproducing the issue.

lukewalczak avatar Apr 11 '22 14:04 lukewalczak

When I use this snack, I get this result phone mode is dark:
image phone mode is light: image

sunnycreature avatar Apr 11 '22 14:04 sunnycreature

@lukewalczak you can see this snack demo, the issue can be seen in RTL mode, https://snack.expo.dev/R4JM_Hf5v

raajnadar avatar Apr 11 '22 15:04 raajnadar