ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

feat: add a way to disable haptics in Ionic components

Open aeharding opened this issue 1 year ago • 5 comments

Prerequisites

Describe the Feature Request

I would like an option to turn off Ionic's built-in haptics.

Describe the Use Case

Users would like an option to turn off all app haptics. Right now it is impossible to turn off Ionic's built-in haptics.

Describe Preferred Solution

setupIonicReact({ haptics: false })

Describe Alternatives

Not an alternative, but a complimentary feature request: it would be nice if Ionic emitted an ionHaptic event (or similar). Such an event would fire regardless of whether setupIonicReact({ haptics: false }) is configured or not. This would lets apps dynamically turn on/off haptics, use custom capacitor haptics libraries, and even disable haptics for certain components (with event.target).

Configuration Built-in haptics triggered? Ionic event triggered (ionHaptic)?
setupIonicReact({ haptics: true }) AKA default Yes Yes
setupIonicReact({ haptics: false }) No Yes

If Ionic is interested in this, I am happy to create a separate feature request.

Related Code

No response

Additional Information

https://github.com/aeharding/voyager/issues/1103

aeharding avatar Dec 18 '23 15:12 aeharding

Thanks for the request. Can you help me understand why you'd like to disable the haptics?

liamdebeasi avatar Dec 18 '23 17:12 liamdebeasi

Thanks for the request. Can you help me understand why you'd like to disable the haptics?

This is a user request I've had a few times, mainly from Android users due to Android haptics being very inconsistent between vendors (and sometimes too strong or weak).

It is currently a setting you can change in Voyager, but only affects Voyager's custom haptics (hence this issue).

Edit: To be clear, disabling haptics is a setting in Voyager users can set if they don't like haptics for whatever reason. Only a small subset of users don't like haptics. Haptics are on by default.

aeharding avatar Dec 18 '23 17:12 aeharding

Thanks for the added info. Is this a problem when changing the haptics preference via a system setting too? On https://github.com/aeharding/voyager/issues/1103 it sounded like turning haptics off in the Android Settings app wasn't actually disabling haptics.

I tested on my end and disabling haptics from the Settings app does disabled haptics.

liamdebeasi avatar Dec 19 '23 19:12 liamdebeasi

That user is referring to a Voyager app setting, not phone setting :)

aeharding avatar Dec 19 '23 19:12 aeharding

Perfect, thanks! I think this is a good feature to have. The team has some concerns about placing this option in the IonicConfig (since the config is not reactive), so we'll need to do some design work first.

liamdebeasi avatar Dec 19 '23 22:12 liamdebeasi