Skip to content

Commit d602665

Browse files
committed
Fix Card being touchable when passing only onLongPress callback
1 parent f9045b7 commit d602665

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/card/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ class Card extends PureBaseComponent {
216216
}
217217

218218
render() {
219-
const {onPress, style, selected, containerStyle, enableBlur, ...others} = this.getThemeProps();
219+
const {onPress, onLongPress, style, selected, containerStyle, enableBlur, ...others} = this.getThemeProps();
220220
const blurOptions = this.getBlurOptions();
221-
const Container = onPress ? TouchableOpacity : View;
221+
const Container = (onPress || onLongPress) ? TouchableOpacity : View;
222222
const brRadius = this.borderRadius;
223223

224224
return (
@@ -233,6 +233,7 @@ class Card extends PureBaseComponent {
233233
style
234234
]}
235235
onPress={onPress}
236+
onLongPress={onLongPress}
236237
delayPressIn={10}
237238
activeOpacity={0.6}
238239
accessibilityState={{selected}}

0 commit comments

Comments
 (0)