Skip to content

Commit

Permalink
feat: enable ipad trackpad two finger back gesture
Browse files Browse the repository at this point in the history
  • Loading branch information
MrLoh authored and satya164 committed May 19, 2021
1 parent d6f6f5f commit 4ec6acd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/stack/src/views/Stack/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ export default class Card extends React.Component<Props> {

private gestureActivationCriteria() {
const { layout, gestureDirection, gestureResponseDistance } = this.props;
const enableTrackpadTwoFingerGesture = true;

const distance =
gestureResponseDistance !== undefined
Expand All @@ -396,12 +397,14 @@ export default class Card extends React.Component<Props> {
maxDeltaX: 15,
minOffsetY: 5,
hitSlop: { bottom: -layout.height + distance },
enableTrackpadTwoFingerGesture,
};
} else if (gestureDirection === 'vertical-inverted') {
return {
maxDeltaX: 15,
minOffsetY: -5,
hitSlop: { top: -layout.height + distance },
enableTrackpadTwoFingerGesture,
};
} else {
const hitSlop = -layout.width + distance;
Expand All @@ -412,12 +415,14 @@ export default class Card extends React.Component<Props> {
minOffsetX: 5,
maxDeltaY: 20,
hitSlop: { right: hitSlop },
enableTrackpadTwoFingerGesture,
};
} else {
return {
minOffsetX: -5,
maxDeltaY: 20,
hitSlop: { left: hitSlop },
enableTrackpadTwoFingerGesture,
};
}
}
Expand Down

0 comments on commit 4ec6acd

Please sign in to comment.