Skip to content

AccessibilityInfo.announceForAccessibility does not work from XamlIslands #7245

@rozele

Description

@rozele

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Copied AccessibilityInfoModule approach into sample XamlIslands app (create TextBlock, use to create automation peer)
  2. Turn on narrator, trigger logic
  3. Narrator does not announce the raised event.

Expected Results

Narrator should speak the text parameter supplied to the announceForAccessibility method. I suspect the automation peer does not work as expected from an element that is not attached to the XamlRoot in XamlIslands.

The previous implementation (added by @acoates-ms) grabbed the XamlRoot from the ReactContext property bag or Window.Content(), but neither of these are guaranteed to create an automation peer.

Snack, code example, screenshot, or link to a repository:

Here's the repro of the announceForAccessibility approach in a standalone XAML Islands app:
https://github.com/rozele/Xaml-Islands-Samples/tree/accessibilityExample

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions