[Composition] Keyboard focus visual not shown when focus is set programmatically or via NavigateFocus into a newly-shown content island
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- cpp, react-native
- Área
- accessibility, desktop
Línea de trabajo
Comienza en el manejo de NavigateFocusRequested y rastrea cómo se usa FocusNavigationReason cuando el foco se mueve a una ReactNativeIsland que acaba de mostrarse. Reproduce tanto la ruta de JS component.focus() como la ruta nativa NavigateFocus(...First) con islas de Composition/Fabric. La tarea está terminada cuando el foco por motivo de teclado muestra el anillo inmediatamente, incluido el foco restaurado después de cerrar un popup, sin introducir regresiones en la navegación de teclado existente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- C++
- Estrellas
- 17.4k
- Forks
- 1.2k
- Merge medio
- 2 d 17 h
- PR fusionados (30 d)
- 13
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/react-native-windows
-
Fabric text is drawn with ClearType onto transparent composition surfaces, fringing thin glyphsAbiertoNeeds: Triage :mag:
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
microsoft/react-native-windows#16340 ·
Los mantenedores suelen responder en 2 días
-
bug Needs: Triage :mag:
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
microsoft/react-native-windows#16321 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Needs: Triage :mag:
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
microsoft/react-native-windows#16442 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Fabric: activating the window doesn't announce the window or the focused control to a screen readerAbiertoNeeds: Triage :mag:
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
microsoft/react-native-windows#16435 ·
Los mantenedores suelen responder en 2 días
-
bug Needs: Triage :mag:
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
microsoft/react-native-windows#16410 ·
Los mantenedores suelen responder en 2 días
Todos los issues de microsoft/react-native-windows
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
ws_bridge: stripping format=evr for matchmaker connections can concatenate the path and queryAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
EchoTools/nevr-runtime#116 ·
Los mantenedores suelen responder en 1 día
-
code-quality libc++
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
llvm/llvm-project#229284 ·
Los mantenedores suelen responder en 1 día
-
test-issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
llvm/offload-test-suite#1557 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día