Repository navigation
Description
Current behavior 🐛
LoopingSelectorItemAutomationPeer never passes its owner to the base peer, so every instance has a
null Owner and throws NullReferenceException the moment the accessibility layer asks it anything.
src/Uno.UI/UI/Xaml/Controls/Primitives/LoopingSelector/LoopingSelectorItemAutomationPeer_Partial.cs:
internal LoopingSelectorItemAutomationPeer(LoopingSelectorItem pOwner)
{
InitializeImpl(pOwner);
}There is no : base(pOwner), so the parameterless FrameworkElementAutomationPeer() runs. In the
ported C++ the owner was wired up by the CreateInstanceWithOwner block that is commented out
immediately below. Its sibling in the same folder does it correctly:
internal LoopingSelectorAutomationPeer(LoopingSelector pOwner) : base(pOwner)On the macOS Skia host this is loud, because MacOSAccessibility resolves a role and applies
attributes for every element entering the tree, catches the exception, and logs it twice. From build
229772 (Run macOS Runtime Tests, 8116 tests, 45 546 log lines):
| line | count |
|---|---|
[A11y] Failed to resolve role for LoopingSelectorItem handle=…: Object reference not set to an instance of an object. |
2879 |
Failed to apply accessibility attributes for …LoopingSelectorItem: Object reference not set to an instance of an object. |
2879 |
Failed to apply accessibility attributes for …ComboBox: Object reference not set to an instance of an object. |
498 |
That is 6256 lines, ~14 % of the entire macOS CI log, from one missing base call. Attributed by
the test running at the time, it concentrates in the pickers:
| test | lines |
|---|---|
When_Time_Zone() |
3306 |
When_Fast_Scrolling_Items_Should_Remain_Visible() |
616 |
When_MonochromaticOverlayPresenter_Workaround() |
194 |
The functional consequence is that LoopingSelectorItem — every row of a TimePicker or
DatePicker flyout — exposes no role and no attributes to VoiceOver at all.
Expected behavior 🎯
LoopingSelectorItemAutomationPeer is constructed with its owner, resolves a role
(GetAutomationControlTypeCore already returns AutomationControlType.ListItem), and reports
attributes to the platform accessibility layer without throwing.
How to reproduce it (as minimally and precisely as possible) 🔬
Run any TimePicker/DatePicker runtime test on the macOS Skia head with debug logging on, e.g.
Given_TimePickerFlyout.When_Time_Zone, and watch for [A11y] Failed to resolve role for LoopingSelectorItem. It is also visible in any macOS CI log; logs are readable anonymously:
https://dev.azure.com/uno-platform/1dd81cbd-cb35-41de-a570-b0df3571a196/_apis/build/builds/229772/logs/505
Workaround 🛠️
None. The exception is caught, so it degrades to "no accessibility for picker items" plus log noise.
Renderer 🎨
Skia
Affected platforms 📱💻🖥️
The peer defect is platform-independent (Uno.UI). It is observed on Skia Desktop (macOS), whose
accessibility layer resolves roles eagerly; any host that queries this peer will hit the same
NullReferenceException.
Uno.Sdk version (and other relevant versions) 📦
Present on feature/breakingchanges; the constructor has been in this shape since the LoopingSelector
port.
IDE version 🧑💻
N/A
Anything else we need to know? 💬
Found while measuring the macOS runtime-test job for #24005. It is not a cause of the freezes tracked
there — the cost is exception throw/catch plus console I/O — but it is the single largest source of
noise in the macOS log, and it is a real accessibility gap for picker items rather than only a
logging problem.
Two adjacent observations, deliberately not folded in here:
MacOSAccessibility.IsAccessibilityEnabledis!IsDisposed && _windowHandle != nint.Zero, i.e.
always true once a window exists, so the whole visual tree is mirrored into native accessibility
elements whether or not any assistive technology is running.Win32Accessibilityhas the same
shape;WebAssemblyAccessibilitygates on an actual_isAccessibilityEnabledflag. Whether the
desktop hosts should gate too is worth its own discussion.- The 498
ComboBoxfailures above are a separate null-reference path in the same code, not
investigated here.
Activity
MartinZikmund commentedon Oct 1, 2026
Additional data point: the same missing
: base(pOwner)also breaks the WebAssembly Skia accessibility layer, via a different member.On WASM Skia CI runtime tests,
WebAssemblyAccessibility.OnChildAddedlogs this for everyLoopingSelectorItem(hundreds per shard), and the item is dropped from the accessibility tree:So the user-visible effect on WASM is that TimePicker/DatePicker flyout items are absent from the accessible tree.
Still present on current master (checked by code inspection: the constructor in
LoopingSelectorItemAutomationPeer_Partial.cshas no: base(pOwner)).Suggested fix, two parts:
: base(pOwner)to the constructor.FrameworkElementAutomationPeer.GetHeadingLevelCore()is=> AutomationProperties.GetHeadingLevel(Owner);with no null guard, unlike e.g.GetAcceleratorKeyCore. Guarding it would make a mis-constructed peer degrade instead of throw.A runtime test could open a
TimePickerflyout and assert that theLoopingSelectorItempeers have a non-nullOwner(and thatGetHeadingLevel()doesn't throw).