Skip to content

Buttons and sidebar items can't be invoked through UI Automation on Windows #25

Open

Description

@Shewart

Summary

On Windows (MAUI), Button and SidebarItem work with the mouse and keyboard, but accessibility tools can't press them:

  • Button appears in the UI Automation tree only as its inner ControlType.Text (Text and ScrollItem patterns), not as a button, and isn't keyboard-focusable in the tree.
  • SidebarItem appears as a focusable ControlType.Group with only the ScrollItem pattern.

Neither offers the Invoke pattern, so Narrator and UI test tools can't activate them.

Steps to reproduce

Open an app with a ShellUI Native Button in Accessibility Insights for Windows (or query it with System.Windows.Automation) and look for the Invoke pattern.

Suggested fix

On Windows, give the clickable root an automation peer with ControlType.Button and IInvokeProvider that calls the same Press(). For example, a handler mapping that wraps the content panel in a subclass overriding OnCreateAutomationPeer, with the automation name taken from Text. Then check other tap-driven controls (pressable Card, TableRow, tabs, toggles) and Avalonia.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions