callstack / callstack/react-native-paper

OutlineStyle crashes on Android but not on iOS

Đang mở
#4,769 2 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
In updating my project to Expo 53 (RN 0.79.5, RNP 5.14.5), I got crashes on Android, but not on iOS. With Expo dev tools it became clear that AndroidTextInput was receiving a ReadableNativeMap that it couldn't cast to a String (in Java). According to RNP:src:components:TextInput:TextInput.tsx:Props:outlineStyle, it's supposed to be a StyleProp, which works fine on iOS. But, on Android, it crashes. Since the type definitions don't allow for the newer (I think) outlineWidth property, I've worked around the problem thus:

const workaround = isAndroid
? { outlineWidth: 1 }
: { outlineStyle: { borderWidth: 1 } }

return

and this seems to work fine.

I don't know where the discrepancy comes it, but maybe someone working on this project knows, FWIW.

### Expected behaviour
No crash, and getting a border of width 1.

### How to reproduce?
Build a project with a Paper TextInput and set outlineStyle to { borderWidth: 1} on Android.

### Preview
https://photos.app.goo.gl/mxwqP1HV19R3tCif9

### What have you tried so far?
I have a workaround; see above

### Your Environment

| software | version
| --------------------- | -------
| ios | x
| android | 14
| react-native | 0.79.5
| react-native-paper | 5.14.5
| node | 22.14.0
| npm or yarn | yarn 4.9.2
| expo sdk | 53.0.19

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

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

Hướng nghiên cứu

Bắt đầu trong src/components/TextInput/TextInput.tsx tại prop outlineStyle và tái hiện lỗi crash Android đã được báo cáo với outlineStyle được đặt thành { borderWidth: 1 }, sử dụng các phiên bản trong issue. Điều tra luồng Android TextInput, sau đó xác minh rằng cùng input đó không còn gây crash và tạo ra đường viền có độ rộng 1.

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

Đánh giá

Công nghệ
android, 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
42/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.