react / react/react-native

There is no way to manage focus for external keyboard from one element to another

Offen
#39,052 7 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

API: Keyboard Issue: Author Provided Repro Needs: Triage :mag:
Vorherrschende Sprache
C++
Sterne
127k
Forks
25.3k
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
4

Beschreibung

Description

Sometimes we need to set external keyboard focus from one place to another, for instance from one Pressable to another Pressable, or from a Pressable to a View.

For Screen Reader users we can use AccessibilityInfo.setAccessibilityFocus(tag) to manage focus, but this technique does not work for the external keyboard when a screen reader is not switched on.

The standard React method of ref.current.focus() also does not work for external keyboard users on mobile (only web).

React Native Version

0.71.3

Output of npx react-native info

I don't have access to this.

Steps to reproduce

On Android or iOS physical device:

  1. Connect a hardware keyboard to the device using bluetooth.
  2. Open https://snack.expo.dev/@nedgip/external-keyboard-focus-example-1 in Expo Go
  3. Navigate to the Send focus button using arrow keys
  4. Press Space
Expected

Focus should move to the Receive focus button

Actual

Focus remains on the Send focus button

Snack, screenshot, or link to a repository
  1. https://snack.expo.dev/@nedgip/external-keyboard-focus-example-1
  2. https://snack.expo.dev/@nedgip/external-keyboard-focus-example-2

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, das Verhalten auf physischen Android- und iOS-Geräten mit einer Hardwaretastatur anhand der beiden verlinkten Expo Snack-Beispiele zu reproduzieren. Verfolge, wie der Fokus beim Aktivieren der Schaltfläche „Send focus“ behandelt wird, und überprüfe anschließend, dass der Fokus ohne aktivierten Screenreader auf die Schaltfläche „Receive focus“ wechselt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
react-native
Bereich
accessibility, mobile
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
52/100

Neue Issues direkt in Ihr Postfach

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