Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
v8.x
Current Behavior
There is a call to hapticImpact
in the ion-refresher (https://github.com/ionic-team/ionic-framework/blame/bcbeeeafb4f1e0596e0b91a39371b80d39aeb49d/core/src/components/refresher/refresher.tsx#L253), but I don't feel a haptic event. (I also don't feel events when calling capacitor haptic plugin methods selectionStart
and selectionEnd
, but as that doesn't concern an Ionic component, I'll open that as an issue on the capacitor page.)
Background: I recently added @capacitor/haptics
to a project and enjoyed getting haptic feedback out-of-the-box from ion-reorder and from ion-toggle (when dragging). I didn't feel any haptic event from the refresh event of ion-refresher, though. Looking at the code, I see in /core/src/components/refresher/refresher.tsx li 253,
if (!this.didRefresh) {
this.beginRefresh();
this.didRefresh = true;
hapticImpact({ style: ImpactStyle.Light });
To replicate, I made a starter Ionic app, added capacitor/haptics plugin, and added ion-refresher to the main page along with buttons to directly activate each of the capacitor haptic methods. (Sample app at https://github.com/andybonner/ionic-refresher-haptic-bug .) I ran the app via XCode, building to a physical iPhone 14 using iOS 18.3.2. The buttons triggered haptic events, including "impact," (though the direct calls to selectionStart
and selectionEnd
didn't seem to; addressing that on capacitor page), but I couldn't feel an event when refreshing.
Expected Behavior
The refresh event of ion-refresher should trigger a haptic "impact" event with style option "light."
Steps to Reproduce
- Add ion-refresher to a page
- Build on physical device (tried on iPhone 14 so far)
- Pull to refresh
Code Reproduction URL
https://github.com/andybonner/ionic-refresher-haptic-bug
Ionic Info
[WARN] Error loading @capacitor/android package.json: Error: Cannot find module '@capacitor/android/package.json'
Require stack:
- /Users/andybonner/.nvm/versions/node/v23.11.0/lib/node_modules/@ionic/cli/lib/project/index.js
- /Users/andybonner/.nvm/versions/node/v23.11.0/lib/node_modules/@ionic/cli/lib/index.js
- /Users/andybonner/.nvm/versions/node/v23.11.0/lib/node_modules/@ionic/cli/index.js
- /Users/andybonner/.nvm/versions/node/v23.11.0/lib/node_modules/@ionic/cli/bin/ionic
Ionic:
Ionic CLI : 7.2.1 (/Users/andybonner/.nvm/versions/node/v23.11.0/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 8.5.5
@angular-devkit/build-angular : 19.2.9
@angular-devkit/schematics : 19.2.9
@angular/cli : 19.2.9
@ionic/angular-toolkit : 12.2.0
Capacitor:
Capacitor CLI : 7.2.0
@capacitor/android : not installed
@capacitor/core : 7.2.0
@capacitor/ios : 7.2.0
Utility:
cordova-res : not installed globally
native-run : 2.0.1
System:
NodeJS : v23.11.0 (/Users/andybonner/.nvm/versions/node/v23.11.0/bin/node)
npm : 11.3.0
OS : macOS Unknown
Additional Information
No response