mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
fix(picker): haptics now work properly (#21268)
This commit is contained in:
@ -2,8 +2,8 @@ import { Component, ComponentInterface, Element, Event, EventEmitter, Host, Prop
|
||||
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
import { Gesture, GestureDetail, PickerColumn } from '../../interface';
|
||||
import { hapticSelectionChanged } from '../../utils/haptic';
|
||||
import { clamp } from '../../utils/helpers';
|
||||
import { hapticSelectionChanged, hapticSelectionEnd, hapticSelectionStart } from '../../utils/native/haptic';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
@ -226,6 +226,7 @@ export class PickerColumnCmp implements ComponentInterface {
|
||||
} else {
|
||||
this.velocity = 0;
|
||||
this.emitColChange();
|
||||
hapticSelectionEnd();
|
||||
}
|
||||
|
||||
} else if (this.y % this.optHeight !== 0) {
|
||||
@ -252,6 +253,8 @@ export class PickerColumnCmp implements ComponentInterface {
|
||||
detail.event.preventDefault();
|
||||
detail.event.stopPropagation();
|
||||
|
||||
hapticSelectionStart();
|
||||
|
||||
// reset everything
|
||||
cancelAnimationFrame(this.rafId);
|
||||
const options = this.col.options;
|
||||
|
Reference in New Issue
Block a user