mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-17 18:54:11 +08:00
fix(datetime): swiping wheel no longer dismisses card modal (#25981)
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
import type { ComponentInterface, EventEmitter } from '@stencil/core';
|
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';
|
import { getElementRoot } from '../../utils/helpers';
|
||||||
|
|
||||||
@ -30,6 +30,19 @@ export class PickerInternal implements ComponentInterface {
|
|||||||
|
|
||||||
@Event() ionInputModeChange!: EventEmitter<PickerInternalChangeEventDetail>;
|
@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() {
|
componentWillLoad() {
|
||||||
getElementRoot(this.el).addEventListener('focusin', this.onFocusIn);
|
getElementRoot(this.el).addEventListener('focusin', this.onFocusIn);
|
||||||
getElementRoot(this.el).addEventListener('focusout', this.onFocusOut);
|
getElementRoot(this.el).addEventListener('focusout', this.onFocusOut);
|
||||||
|
Reference in New Issue
Block a user