Skip to content

Commit a3222f7

Browse files
committed
Set default elevation of react-native-paper Card to 0 on Android P and above till transitions with opacity are resolved.
1 parent 10f368d commit a3222f7

File tree

3 files changed

+328
-11
lines changed

3 files changed

+328
-11
lines changed

package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"test": "jest",
1010
"flow": "flow --include-warnings",
1111
"lint": "eslint .",
12-
"ci": "npm test && npm run lint && npm run flow"
12+
"ci": "npm test && npm run lint && npm run flow",
13+
"prepare": "patch-package"
1314
},
1415
"dependencies": {
1516
"bugsnag-react-native": "^2.10.2",
@@ -22,7 +23,7 @@
2223
"react-native-calendars": "^1.21.0",
2324
"react-native-gesture-handler": "^1.0.10",
2425
"react-native-i18n": "^2.0.12",
25-
"react-native-paper": "^2.11.0",
26+
"react-native-paper": "^2.11.1",
2627
"react-native-vector-icons": "^4.6.0",
2728
"react-navigation": "^3.0.8",
2829
"react-navigation-backhandler": "^1.1.1",
@@ -42,6 +43,8 @@
4243
"flow-bin": "0.78.0",
4344
"jest": "^24.0.0-alpha.12",
4445
"metro-react-native-babel-preset": "^0.50.0",
46+
"patch-package": "^6.0.4",
47+
"postinstall-prepare": "^1.0.1",
4548
"react-dom": "^16.3.1",
4649
"react-native-testing-library": "^1.5.0",
4750
"react-test-renderer": "16.6.3"
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
diff --git a/node_modules/react-native-paper/src/components/Card/Card.js b/node_modules/react-native-paper/src/components/Card/Card.js
2+
index 923afbc..0191d7a 100644
3+
--- a/node_modules/react-native-paper/src/components/Card/Card.js
4+
+++ b/node_modules/react-native-paper/src/components/Card/Card.js
5+
@@ -4,6 +4,7 @@ import * as React from 'react';
6+
import {
7+
Animated,
8+
View,
9+
+ Platform,
10+
TouchableWithoutFeedback,
11+
StyleSheet,
12+
} from 'react-native';
13+
@@ -89,7 +90,7 @@ class Card extends React.Component<Props, State> {
14+
static Title = CardTitle;
15+
16+
static defaultProps = {
17+
- elevation: 1,
18+
+ elevation: Platform.OS === 'android' && Platform.Version >= 28 ? 0 : 1,
19+
};
20+
21+
state = {

0 commit comments

Comments
 (0)