EddyVerbruggen / cordova-plugin-taptic-engine

:vibration_mode: Use Apple's Taptic Engine to vibrate your iPhone 6s (or up) in a variety of ways
MIT License
62 stars 12 forks source link

Disable Haptic Feedback #7

Closed jjwall closed 4 years ago

jjwall commented 4 years ago

I'm currently building an iOS app using Cordova and was wondering if you could somehow use this plugin to disable the haptic feedback or small vibration that occurs when you tap and hold (long press) for a few milliseconds within the app? For iOS web apps, it seems like that this little haptic feedback that occurs is an inherent part of the design so I imagine the only way to disable this would be via native APIs and not with an html / css / js solution.

Also, I wrote a TypeScript type definition file for this plugin if anyone would like me to share!

jjwall commented 4 years ago

Update: I discovered the solution! I just needed to call preventDefault() for the TouchEvent from the "touchstart" event listener.