Skip to content

ui.focused_element() sometimes returns <NoElement> #480

Closed
@phillco

Description

@phillco

Occasionally ui.focused_element() returns <NoElement>, but ui.active_app().element.AXFocusedUIElement does return the correct element.

This happens to me in Xcode 13.2.1 on Monterey 12.2. It also happens frequently in Messages.app, Notes.app, and TextEdit.app after restarting Talon. Generally, restarting the application, and/or cycling through several of its views (i.e. focusing different notes in Notes.app) can fix it.

Generally when this happens, element_focused events are also not fired.

I can work around most of this for now by implementing a general action to get the focused element, with the fallback. Although I don't think I can work around the lack of focused events.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions