Skip to content

Commit

Permalink
fix(datetime): swiping wheel no longer dismisses card modal (#25981)
Browse files Browse the repository at this point in the history
  • Loading branch information
liamdebeasi authored Sep 21, 2022
1 parent 21dc893 commit 7543c84
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion core/src/components/picker-internal/picker-internal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ComponentInterface, EventEmitter } from '@stencil/core';
import { Component, Element, Event, Host, h } from '@stencil/core';
import { Component, Element, Event, Listen, Host, h } from '@stencil/core';

import { getElementRoot } from '../../utils/helpers';

Expand Down Expand Up @@ -30,6 +30,19 @@ export class PickerInternal implements ComponentInterface {

@Event() ionInputModeChange!: EventEmitter<PickerInternalChangeEventDetail>;

/**
* When the picker is interacted with
* we need to prevent touchstart so other
* gestures do not fire. For example,
* scrolling on the wheel picker
* in ion-datetime should not cause
* a card modal to swipe to close.
*/
@Listen('touchstart')
preventTouchStartPropagation(ev: TouchEvent) {
ev.stopPropagation();
}

componentWillLoad() {
getElementRoot(this.el).addEventListener('focusin', this.onFocusIn);
getElementRoot(this.el).addEventListener('focusout', this.onFocusOut);
Expand Down

0 comments on commit 7543c84

Please sign in to comment.