mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
fix(datetime): haptics are enabled only on ios (#26370)
resolves #25508 BREAKING CHANGE: The haptics when swiping the wheel picker are now enabled only on iOS.
This commit is contained in:
@ -104,6 +104,8 @@ This section details the desktop browser, JavaScript framework, and mobile platf
|
|||||||
|
|
||||||
- Passing the empty string to the `value` property will now error as it is not a valid ISO-8601 value.
|
- Passing the empty string to the `value` property will now error as it is not a valid ISO-8601 value.
|
||||||
|
|
||||||
|
- The haptics when swiping the wheel picker are now enabled only on iOS.
|
||||||
|
|
||||||
<h4 id="version-7x-input">Input</h4>
|
<h4 id="version-7x-input">Input</h4>
|
||||||
|
|
||||||
- `ionChange` is no longer emitted when the `value` of `ion-input` is modified externally. `ionChange` is only emitted from user committed changes, such as typing in the input and the input losing focus or from clicking the clear action within the input.
|
- `ionChange` is no longer emitted when the `value` of `ion-input` is modified externally. `ionChange` is only emitted from user committed changes, such as typing in the input and the input losing focus or from clicking the clear action within the input.
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import type { ComponentInterface, EventEmitter } from '@stencil/core';
|
import type { ComponentInterface, EventEmitter } from '@stencil/core';
|
||||||
import { Component, Element, Event, Host, Method, Prop, State, Watch, h } from '@stencil/core';
|
import { Component, Element, Event, Host, Method, Prop, State, Watch, h } from '@stencil/core';
|
||||||
|
import { isPlatform } from '@utils/platform';
|
||||||
|
|
||||||
import { getIonMode } from '../../global/ionic-global';
|
import { getIonMode } from '../../global/ionic-global';
|
||||||
import type { Color } from '../../interface';
|
import type { Color } from '../../interface';
|
||||||
@ -229,6 +230,12 @@ export class PickerColumnInternal implements ComponentInterface {
|
|||||||
* the item object.
|
* the item object.
|
||||||
*/
|
*/
|
||||||
private initializeScrollListener = () => {
|
private initializeScrollListener = () => {
|
||||||
|
/**
|
||||||
|
* The haptics for the wheel picker are
|
||||||
|
* an iOS-only feature. As a result, they should
|
||||||
|
* be disabled on Android.
|
||||||
|
*/
|
||||||
|
const enableHaptics = isPlatform('ios');
|
||||||
const { el } = this;
|
const { el } = this;
|
||||||
|
|
||||||
let timeout: any;
|
let timeout: any;
|
||||||
@ -242,7 +249,7 @@ export class PickerColumnInternal implements ComponentInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!this.isScrolling) {
|
if (!this.isScrolling) {
|
||||||
hapticSelectionStart();
|
enableHaptics && hapticSelectionStart();
|
||||||
this.isScrolling = true;
|
this.isScrolling = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,7 +275,7 @@ export class PickerColumnInternal implements ComponentInterface {
|
|||||||
* we need to run haptics again.
|
* we need to run haptics again.
|
||||||
*/
|
*/
|
||||||
if (activeElement !== activeEl) {
|
if (activeElement !== activeEl) {
|
||||||
hapticSelectionChanged();
|
enableHaptics && hapticSelectionChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
activeEl = activeElement;
|
activeEl = activeElement;
|
||||||
@ -276,7 +283,7 @@ export class PickerColumnInternal implements ComponentInterface {
|
|||||||
|
|
||||||
timeout = setTimeout(() => {
|
timeout = setTimeout(() => {
|
||||||
this.isScrolling = false;
|
this.isScrolling = false;
|
||||||
hapticSelectionEnd();
|
enableHaptics && hapticSelectionEnd();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Certain tasks (such as those that
|
* Certain tasks (such as those that
|
||||||
|
|||||||
Reference in New Issue
Block a user