Skip to content

bug: Haptic impact not playing for ion-refresher #30376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
andybonner opened this issue Apr 29, 2025 · 1 comment
Closed
3 tasks done

bug: Haptic impact not playing for ion-refresher #30376

andybonner opened this issue Apr 29, 2025 · 1 comment
Labels

Comments

@andybonner
Copy link

Prerequisites

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

@ionitron-bot ionitron-bot bot added the triage label Apr 29, 2025
@andybonner
Copy link
Author

Oops, I figured it out. I have <ion-refresher-content pullingIcon="arrow-down" refreshingSpinner="circular"></ion-refresher-content>. Ion-refresher documentation says "The native refreshers can be disabled by setting the pullingIcon on the refresher content to any icon or spinner." The haptic event referenced is inside the block for the native refresher.

Closing the issue, though it would be nice to mention haptics in the documentation (as well as for ion-reorder and ion-toggle) and make it clear that customizing the pullingIcon means giving them up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant