[Fabric][Composition] Expose a non-mutating focusability API on ComponentView (e.g. IsFocusable ) for FocusZone / single-tab-stop scenarios
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
- 45/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- cpp, react-native
- Área
- desktop-dev, frontend
Línea de trabajo
Comienza rastreando ComponentView.TryFocus y el punto de entrada solicitado, no mutante, para determinar la posibilidad de recibir el foco en la implementación de Composition. Después inspecciona Composition.FocusManager.FindFirstFocusableElement, FindLastFocusableElement y GettingFocusEventArgs.TrySetNewFocusedComponent, incluida la ruta de activación de IFocusManagerStatics. Se considera terminado cuando la consulta principal está disponible sin mover el foco y el comportamiento de la API secundaria para aplicaciones RNW alojadas está aclarado o corregido.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem Description
Building a FocusZone / single-tab-stop control on Composition (New Architecture) requires identifying the next focusable ComponentView in tab order. Today there is no non-mutating way to test whether a ComponentView can take focus, so we must call ComponentView.TryFocus(...) in a loop — which moves focus as a side effect while probing. We need a query API that reports focusability without changing focus.
What we're doing
Native RCTFocusZone implementation. On Tab we want to move focus to the first focusable element outside the zone in one transition; arrow keys navigate within. To find that element we DFS the tree and call TryFocus on each candidate until one succeeds, because there's no way to ask "is this focusable?" first.
Gaps
- No non-mutating focusability property on ComponentView . Requesting an IsFocusable / Focusable (get-only bool ) property, so we can select the correct target without side-effecting focus.
- Composition.FocusManager.FindFirstFocusableElement / FindLastFocusableElement statics throw — their activation factory ( IFocusManagerStatics ) isn't registered in the runtime we load, so get_activation_factory throws (fatal inside a noexcept input handler). If these are the intended API, they need to be usable from a hosted RNW app.
- GettingFocusEventArgs.TrySetNewFocusedComponent(ComponentView) projects as void (no success bool ), so we can't redirect focus during GettingFocus and know whether it was accepted, forcing focus logic into KeyDown instead.
Ask
Primarily (1) a non-mutating focusability query on ComponentView . Secondarily, clarify/fix (2) and (3) so focus navigation can be built without trial-and-error TryFocus .
Workaround
DFS + TryFocus trial-and-error in KeyDown , which mutates focus while probing and costs a tree walk per keystroke.
Steps To Reproduce
- In a react-native-windows Fabric (Composition / New Architecture) app, add a native
component (e.g. a custom FocusZone) that subclasses the codegen ComponentView and, in
Initialize, registers a KeyDown handler on the container ComponentView. - In that handler, try to move keyboard focus to the next focusable ComponentView in tab
order (e.g. on Tab, the first focusable element outside the zone). To do this you must
determine which ComponentView can accept focus. - Look for a non-mutating way to test whether a given ComponentView is focusable. There is
none: ComponentView.TryFocus(FocusState) is the only option, and it moves focus as a
side effect while probing. - Result: you have to call TryFocus in a loop across candidate views, causing focus to
actually move during probing, and there is no API to identify the correct target up front.
Expected Results
No response
CLI version
CLI version is 13.6.9
Environment
react-native-windows 0.81.5 (Fabric / Composition), Microsoft.ReactNative C++/WinRT
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
- 3 d 10 min
- PR fusionados (30 d)
- 14
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
-
Single-line TextInput text is drawn below center and clipped on ARM64 (New Architecture)Posiblemente ocupada @ryfow la tomó hace 3 días. Abiertobug Needs: Triage :mag:
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
microsoft/react-native-windows#16481 ·
Los mantenedores suelen responder en 2 días
-
bug Needs: Triage :mag:
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
microsoft/react-native-windows#16479 ·
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 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
Todos los issues de microsoft/react-native-windows
Issues similares
-
bot-triaged module: correctness (silent) module: mps module: NaNs and Infs triage review
Dificultad 2/5 Medio día Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
README: CI link/badge checkAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
SCIInstitute/SCIRun#2842 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
agent:Windows bug code-review LOW testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
Los mantenedores suelen responder en 1 día