MCPcopy
hub / github.com/xiaolin/react-image-gallery / shouldIgnoreSwipeDirection

Function shouldIgnoreSwipeDirection

src/components/utils/swipe.ts:168–178  ·  view source on GitHub ↗
(
  direction: SwipeDirection,
  slideVertically: boolean
)

Source from the content-addressed store, hash-verified

166 * Returns true if the swipe should be ignored.
167 */
168export function shouldIgnoreSwipeDirection(
169 direction: SwipeDirection,
170 slideVertically: boolean
171): boolean {
172 const isSwipeLeftOrRight = direction === "Left" || direction === "Right";
173 const isSwipeTopOrDown = direction === "Up" || direction === "Down";
174
175 if (isSwipeLeftOrRight && slideVertically) return true;
176 if (isSwipeTopOrDown && !slideVertically) return true;
177 return false;
178}

Callers 2

ImageGallery.tsxFile · 0.90
swipe.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected