Skip to content

Instantly share code, notes, and snippets.

@mmirolim
Last active August 29, 2015 14:03
Show Gist options
  • Save mmirolim/9b7f85bf22d944c9d155 to your computer and use it in GitHub Desktop.
Save mmirolim/9b7f85bf22d944c9d155 to your computer and use it in GitHub Desktop.
Auto focus to popups
/**
* Directive to focus autocomplete popover when it shown
* @author Mirolim Mirzakhmedov mirolim777 at gmail dot com
*/
app.directive('focusPopover', function($timeout) {
return function(scope, element) {
$timeout(function() {
element.focus();
});
}
});
// add to popovers
focus-popover="true" ng-blur="popover.type = false;popover.style = false; popover = {}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment