callstack / callstack/react-native-paper

bug: outlined TextInput labels resizing with imperatively set value

Aperta
#4,245 1 commento 5 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
TypeScript
Stelle
14.5k
Fork
2.2k
Merge medio
5g 23h
PR unite (30g)
12

Descrizione

### Current behaviour
There is a visual bug introduced in [5.11.0](https://github.com/callstack/react-native-paper/compare/v5.10.6...v5.11.0) related to the`outlined` styled `TextInput` that is causing inputs with their values set imperatively, either via `defaultValue` or `value` render the label and then snap to the left margin.

https://github.com/callstack/react-native-paper/assets/5914225/408f84ae-38e5-4364-bc03-0144d31ef09b

### Expected behaviour
Prior to 5.11.0, labels rendered in the expected position.

https://github.com/callstack/react-native-paper/assets/5914225/fff05db6-9270-4533-83c5-6985c27e37b7

### How to reproduce?
Added a `TextInput` components with `mode="outlined"` and an imperatively set value. `value` and `defaultValue` will both result in the behavior. Expect the input to display the label snapping behavior on initial render.
``

### Preview
- Video examples above

### What have you tried so far?
- [Expo Snack](https://snack.expo.dev/@awalker00/outlined-input-label)

### Your Environment

| software | version
| --------------------- | -------
| ios | 16, 17
| android | 32, 33
| react-native | 0.71, 0.72
| react-native-paper | 5.11.x
| node | 18.7.0
| npm or yarn | npm
| expo sdk | 49.0.0

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start by reproducing the issue with the provided outlined TextInput snippet using both value and defaultValue, then compare behavior between react-native-paper 5.10.6 and 5.11.x. Trace the outlined TextInput implementation and verify that the label remains in its expected position on initial render across the listed iOS and Android environments.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
react-native, typescript
Ambito
mobile
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.