[A11y]Fix: Prevent Tab crash in model picker: replace ItemsView with ItemsRepeater #501
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ADO 58931060
Summary
Pressing Tab from the “Download model” button inside the “Select a model to use for this sample” dialog caused the entire app to close. The crash occurred whenever focus moved into the ItemsView that rendered selected models. Replacing ItemsView with ItemsRepeater removes the crash and restores proper keyboard focus order.
User Impact (A11y)
Keyboard-only users (WCAG 2.1.1 Keyboard) could not proceed past the dialog: a Tab keystroke closed the app. This blocked model selection and sample execution. The fix removes the unexpected termination and preserves linear focus navigation, improving accessibility compliance and usability.
Root Cause (Likely)
When focus moves from the “Download model” button to the ItemsView, the framework requests a UI Automation interface (COM) not implemented by the generated peer chain. The sequence triggers System.InvalidCastException with HRESULT 0x80004002 (E_NOINTERFACE: “No such interface supported”). The ItemsView + ItemContainer usage inside this overlay is sufficient to reproduce the failure; substituting ItemsRepeater immediately removes the exception. This strongly suggests an upstream ItemsView focus navigation bug.

Why ItemsRepeater Instead of ItemsView Here
Contextual needs are minimal: horizontal display of a small set of selected models, each updating as the user chooses a model type.
ItemsView advantages (not needed here): built‑in selection state, item invoked event, auto focus/selection patterns.
ItemsRepeater advantages for this case:
Trade-off: We implement a tiny selection index ourselves (few lines). No lost functionality for this dialog.
Validation
Risk Assessment
Low. The replaced control is isolated to the dialog. ItemsRepeater is stable and widely used. The only behavior changed is internal selection plumbing (now explicit rather than implicit). If future upstream ItemsView bug fix appears, we can revert with limited impact.