[Composition] Keyboard focus visual not shown when focus is set programmatically or via NavigateFocus into a newly-shown content island
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- cpp, react-native
- Ambito
- accessibility, desktop
Direzione di ricerca
Inizia dalla gestione di NavigateFocusRequested e traccia come viene usato FocusNavigationReason quando il focus si sposta in una ReactNativeIsland appena mostrata. Riproduci sia il percorso JS component.focus() sia il percorso nativo NavigateFocus(...First) con isole Composition/Fabric. Il lavoro è completato quando il focus dovuto alla tastiera mostra immediatamente l’anello, incluso il ripristino del focus dopo la chiusura di un popup, senza regressioni nella navigazione da tastiera esistente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem Description
In react-native-windows (Composition / Fabric), the keyboard focus ring
(focus visual) is drawn only after a real keyboard event has occurred
within a given ReactNativeIsland. When focus is placed programmatically
— either JS component.focus() or native
InputFocusNavigationHost.GetForSiteBridge(bridge).NavigateFocus(FocusNavigationRequest.Create(FocusNavigationReason.First))
— focus moves correctly (UIA/Narrator announces the element) but the island is
not put into the "show focus visuals" state, so no ring is rendered
until the user presses Tab/arrow inside that island.
The "keyboard mode" that enables the ring appears to be tracked per island:
a keypress that happened in island A does not enable focus visuals for a
programmatic focus placed into a freshly-shown island B.
Steps To Reproduce
- Build an app with two Composition content islands (each its own
ReactNativeIsland) — e.g. a main view and a popup/menu shown in a separate
island. - Show the popup island and set focus on its first item, using either:
- JS:
firstItemRef.current.focus(), or - native:
InputFocusNavigationHost.GetForSiteBridge(bridge).NavigateFocus(FocusNavigationRequest.Create(FocusNavigationReason.First))
- JS:
- Observe the item is focused (Narrator announces it) but no focus ring is drawn.
- Press Tab or an arrow key → the focus ring now appears and behaves correctly.
Expected Results
When focus is moved with a keyboard navigation reason
(First / Last / directional), RNW should render the focus visual — matching
XAML/WinUI FocusState.Keyboard semantics. At minimum, there should be a way to
request keyboard focus visuals when setting focus programmatically (so a menu/
popup that opens via keyboard shows a ring on its initial item, and focus
restored to a caller after dismissing a popup shows a ring).
Actual results:
No focus ring is drawn on the initially focused element until the user presses
a key in that island. enableFocusRing is true on the components (the ring
renders correctly once keyboard navigation occurs).
Investigation suggests the NavigateFocusRequested handling moves focus but
ignores the FocusNavigationReason for focus-visual purposes, so even the
native NavigateFocus(...First) path does not enable the ring.
CLI version
CLI 0.81.3
Environment
- react-native-windows: 0.81.5
- @react-native-windows/cli: 0.81.3
- react-native: 0.81.5
- UI library: @fluentui/react-native 0.42.24 (ButtonV1, enableFocusRing)
- Architecture: Composition / Fabric, DesktopChildSiteBridge content islands
- Windows App SDK: bundled via host app (1.x)
- OS: Windows 11 (x64)
Community Modules
No response
Target React Native Architecture
None
Target Platform Version
None
Visual Studio Version
None
Build Configuration
None
Snack, code example, screenshot, or link to a repository
No response
- Lingua principale
- C++
- Stelle
- 17.4k
- Fork
- 1.2k
- Merge medio
- 2g 17h
- PR unite (30g)
- 13
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/react-native-windows
-
Fabric text is drawn with ClearType onto transparent composition surfaces, fringing thin glyphsApertaNeeds: Triage :mag:
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
microsoft/react-native-windows#16340 ·
I maintainer di solito rispondono entro 2 giorni
-
bug Needs: Triage :mag:
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
microsoft/react-native-windows#16321 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Needs: Triage :mag:
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
microsoft/react-native-windows#16442 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Fabric: activating the window doesn't announce the window or the focused control to a screen readerApertaNeeds: Triage :mag:
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
microsoft/react-native-windows#16435 ·
I maintainer di solito rispondono entro 2 giorni
-
bug Needs: Triage :mag:
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
microsoft/react-native-windows#16410 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di microsoft/react-native-windows
Issue simili
-
code-quality libc++
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
llvm/llvm-project#229284 ·
I maintainer di solito rispondono entro 1 giorno
-
test-issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
llvm/offload-test-suite#1557 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
iOS: hidden scale bar invalidates its intrinsic content size on every layout pass of MLNMapViewAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
maplibre/maplibre-native#4723 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
HarbourMasters/Shipwright#7320 ·
I maintainer di solito rispondono entro 1 giorno