ionic-team / ionic-team/ionic-framework

feat: add a way to disable haptics in Ionic components

Ouverte
#28,719 5 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
package: core type: feature request
Langage dominant
TypeScript
Étoiles
52.7k
Forks
13.3k
Merge moyen
1 j 15 h
PR mergées (30 j)
51

Description

### Prerequisites

- [X] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#creating-an-issue).
- [X] I agree to follow the [Code of Conduct](https://ionicframework.com/code-of-conduct).
- [X] I have searched for [existing issues](https://github.com/ionic-team/ionic-framework/issues) that already include this feature request, without success.

### 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

```ts
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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Start by reviewing the setupIonicReact entry point and tracing how Ionic components trigger built-in haptics. Define how the haptics option and the proposed ionHaptic event should interact, then verify that disabling built-in haptics still permits the event and that the behavior applies consistently across components.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
react, typescript
Domaine
frontend, mobile-dev
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.