Skip to content

Commit

Permalink
feat(esl-event-listener): add isVertical property to `ESLSwipeGestu…
Browse files Browse the repository at this point in the history
…reEvent`
  • Loading branch information
NastaLeo committed Jan 24, 2024
1 parent e4fb592 commit 019715c
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ export class ESLSwipeGestureEvent extends UIEvent implements ESLSwipeGestureEven
public readonly startEvent: PointerEvent;
public readonly duration: number;

/** @returns whether swipe direction is vertical or not */
public get isVertical(): boolean {
return this.direction === 'up' || this.direction === 'down';
}

protected constructor(target: Element, swipeInfo: ESLSwipeGestureEventInfo) {
super(ESLSwipeGestureEvent.type, {bubbles: false, cancelable: true});
overrideEvent(this, 'target', target);
Expand Down

0 comments on commit 019715c

Please # to comment.