You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the application's effective theme differs from a subtree's RequestedTheme (e.g. system/app is Dark but a Frame/Page sets RequestedTheme=Light), the keyboard focus visual on elements inside that subtree renders with the application's theme colors instead of the element's theme colors.
For example, with Application.RequestedTheme = Dark and myFrame.RequestedTheme = Light, focusing a control inside myFrame shows the Dark-theme focus visual (white outer, black inner) instead of the expected Light-theme one (dark outer, white inner).
Expected behavior 🎯
The focus visual should follow the focused element's effective theme — its own RequestedTheme or the nearest ancestor's — matching WinUI behavior.
How to reproduce it (as minimally and precisely as possible) 🔬
Run an Uno Platform app on Skia (Desktop or WebAssembly).
Set Application.Current.RequestedTheme = ApplicationTheme.Dark (or let it follow a Dark system theme).
Set RequestedTheme=Light on a Frame/Page containing focusable controls.
Tab to a control inside that Frame.
Observed: focus visual uses Dark-theme brushes.
Expected: focus visual uses Light-theme brushes (because the focused element's effective theme is Light).
Root cause
DependencyProperty.GetDefaultValue resolves FocusVisualPrimaryBrush / FocusVisualSecondaryBrush via ResourceResolver.TryStaticRetrieval("SystemControlFocusVisualPrimaryBrush", null, …) — the null context means the lookup uses the application's active theme rather than the focused element's effective theme. WinUI resolves against targetObject->GetTheme() (see CDependencyProperty::GetDefaultFocusVisualBrush in microsoft-ui-xaml2/src/dxaml/xcp/core/core/elements/DependencyProperty.cpp).
Renderer 🎨
Skia
Native
Affected platforms 📱💻🖥️
WebAssembly, Desktop (Windows/macOS/Linux via Skia)
Uno.Sdk version
6.7.0-dev.29 and earlier (still reproduces on the latest dev versions, even after #23178 / #23197).
Activity