Skip to content
This repository has been archived by the owner on Feb 8, 2020. It is now read-only.

Commit

Permalink
fix: conditions in gesture direction
Browse files Browse the repository at this point in the history
  • Loading branch information
osdnk committed Oct 22, 2019
1 parent f9cfbd0 commit 225e760
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/stack/src/views/Stack/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -713,13 +713,16 @@ export default class Card extends React.Component<Props> {
private gestureActivationCriteria() {
const { layout, gestureDirection, gestureResponseDistance } = this.props;

// Doesn't make sense for a response distance of 0, so this works fine
const distance =
gestureDirection === 'vertical'
? (gestureResponseDistance && gestureResponseDistance.vertical) ||
GESTURE_RESPONSE_DISTANCE_VERTICAL
: (gestureResponseDistance && gestureResponseDistance.horizontal) ||
GESTURE_RESPONSE_DISTANCE_HORIZONTAL;
? gestureResponseDistance &&
gestureResponseDistance.vertical !== undefined
? gestureResponseDistance.vertical
: GESTURE_RESPONSE_DISTANCE_VERTICAL
: gestureResponseDistance &&
gestureResponseDistance.horizontal !== undefined
? gestureResponseDistance.horizontal
: GESTURE_RESPONSE_DISTANCE_HORIZONTAL;

if (gestureDirection === 'vertical') {
return {
Expand Down

0 comments on commit 225e760

Please sign in to comment.