Skip to content

SemanticScreenReader.Default.Announce throws exception when called from MainPage constructor #21121

Open
@andrewstellman

Description

@andrewstellman

Description

Calling SemanticScreenReader.Default.Announce to announce text as soon as the window opens by calling its Announce method from a page constructor throws an exception. I've reproduced this in Windows. In macOS it doesn't throw an exception, but does not make any announcements.

To reproduce this, create a new .NET MAUI app and change the constructor in MainPage.xaml.cs to call SemanticScreenReader.Default.Announce:

        public MainPage()
        {
            InitializeComponent();
            SemanticScreenReader.Default.Announce("The app has started.");
        }

It throws the exception: System.NullReferenceException: 'Object reference not set to an instance of an object.'

image

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.3 GA

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

7.0.101

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

Unfortunately, no.

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-essentialsEssentials: Device, Display, Connectivity, Secure Storage, Sensors, App Infolegacy-area-a11yRelates to accessibilitypartner/syncfusionIssues / PR's with Syncfusion collaborationplatform/windowspotential-regressionThis issue described a possible regression on a currently supported version., verification pendings/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/a11yRelates to accessibilityt/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions