callstack / callstack/react-native-paper

bug: outlined TextInput labels resizing with imperatively set value

Đang mở
#4,245 1 bình luận 5 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
TypeScript
Star
14.5k
Fork
2.2k
Merge trung bình
5 ngày 23 giờ
Pull request đã merge (30 ngày)
12

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện vấn đề với đoạn mã TextInput outlined được cung cấp, sử dụng cả value và defaultValue, sau đó so sánh hành vi giữa react-native-paper 5.10.6 và 5.11.x. Theo dõi phần triển khai của outlined TextInput và xác minh rằng nhãn vẫn ở vị trí mong đợi khi render lần đầu trong các môi trường iOS và Android được liệt kê.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
react-native, typescript
Lĩnh vực
mobile
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
48/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.