onTap does not recognize longer taps

Offen
#8,326 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
typescript

Rechercherichtung

Beginne damit, den Einstiegspunkt des onTap-Ereignisses und die von NativeScript-Steuerelementen verwendete Verarbeitung von Touch-Ereignissen zu finden. Vergleiche, wie Aktionen beim Loslassen für kurze und lange Druckvorgänge behandelt werden, und prüfe anschließend das relevante Android- und iOS-Verhalten im Hinblick auf das gewünschte Accessibility-Ergebnis. Als abgeschlossen gilt die Aufgabe, wenn ein längerer Druck beim Loslassen onTap auslöst, ohne das Verhalten von longPress zu beeinträchtigen, und dies für beide Plattformen abgedeckt ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

enhancement os: android

Is your feature request related to a problem? Please describe.

The onTap event is only triggered by short taps where the finger is released quickly. If you hold down the finger for too long, the onTap event gets cancelled. In terms of accessibility (weak fingers, loss of tactile sensitivity, bad eyesight) and external consistency (compare to standard tap events on Android and iOS built-in apps), this is undesirable. Imagine a user that has weakened fingers due to for example multiple sclerosis, who adopts a usage pattern where buttons are tapped for seconds at a time to ensure that the button was hit.
There is a longPress event but that does not trigger on release like onTap so it does not solve the problem.

Describe the solution you'd like

The onTap event should not be cancelled by default for longer presses.

Describe alternatives you've considered

A workaround for that worked for us is to use the touch event instead of onTap, and check if the action type was "up".
This is what it looks like in vue in the context of a RadListView:

<Ripple
        @touch="onItemSelected($event, index)"
        ...


private onItemSelected(event, index): void {
        if (event.action === "up") {
                //Do the thing
        }
}

Additional context

Relevant WCAG guideline: https://www.w3.org/TR/WCAG21/#pointer-cancellation

Vorherrschende Sprache
TypeScript
Sterne
25.7k
Forks
1.7k
Ø Merge
1 T. 5 Std.
Gemergte PRs (30 T.)
35

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus NativeScript/NativeScript

Alle Issues in NativeScript/NativeScript

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.