Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

currently focused element lost in ng-click handler #5010

Closed
@alanhamlett

Description

@alanhamlett

For example, I want to get the currently focused element.

Template:

<input type="text" />
<a href="#" ng-click="gotClicked()">click me to see which element is focused</a>

Controller:

...
$scope.gotClicked = function() {
    console.log(document.activeElement);
};
...

Try focusing on the text input and then click the link. The text input should be logged to the console, but it's not.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions