callstack / callstack/react-native-paper

Elevation prop does not work for M2 theme

オープン
#4,413 コメント 0 件 リアクション 2 件 担当者 0 名 GitHub で見る
bug
主要言語
TypeScript
スター
14.5k
フォーク
2.2k
平均マージ
5日 23時間
マージ済み PR(30日)
12

説明

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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。