callstack / callstack/react-native-paper

Elevation prop does not work for M2 theme

Đang mở
#4,413 0 bình luận 2 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
According to documentation
"In version 2 the `elevation` prop was accepted via `style` prop i.e. `style={{ elevation: 4 }}`.
It's no longer supported with theme version 3 and you should use `elevation` property instead."

But in reality, even if we use style with `elevation: 0`. it does not affect the button at all.

### Expected behaviour

After adding the style={{ elevation: 0 }} on M2 themed contained button it should not contain any shadows, and must behave like a flat button.

### How to reproduce?

- use Button component with `mode=contained`
- make sure to have theme version 2 enabled
- add `style={{ elevation: 0 }}` to the Button

Reproduced Snack

https://snack.expo.dev/@stanwar/react-native-paper-m2-button-issue

### Preview

### What have you tried so far?

### Your Environment

| software | version
| --------------------- | -------
| ios | N/A
| android | 14
| react-native | 0.73.6
| react-native-paper | 5.12.3
| node | 20.11.1
| npm or yarn | 1.22.22 (Yarn)
| expo sdk | None (bare project)

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

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

Hướng nghiên cứu

Start with the React Native Paper Button component and its theme-version-specific elevation handling, then reproduce the behavior using the linked Snack or the provided Android setup. Trace how a contained M2 button applies style elevation and verify that style={{ elevation: 0 }} removes its shadow without affecting other button modes.

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
frontend, mobile-dev
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
45/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.