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

currently focused element lost in ng-click handler #5010

Closed
alanhamlett opened this issue Nov 18, 2013 · 2 comments
Closed

currently focused element lost in ng-click handler #5010

alanhamlett opened this issue Nov 18, 2013 · 2 comments

Comments

@alanhamlett
Copy link

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.

@alanhamlett
Copy link
Author

Related to issue #2012

@IgorMinar
Copy link
Contributor

this is not an angular specific issue, please see that the behavior is the same with plane html: http://plnkr.co/edit/YbEs2FQYICmH7SGguqD8?p=preview

I'm closing this in favor of #2012

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants