angular-ui / bootstrap

PLEASE READ THE PROJECT STATUS BELOW. Native AngularJS (Angular) directives for Bootstrap. Smaller footprint (20kB gzipped), no 3rd party JS dependencies (jQuery, bootstrap JS) required. Please read the README.md file before submitting an issue!
http://angular-ui.github.io/bootstrap/
MIT License
14.3k stars 6.74k forks source link

typeahead focus will re-trigger in some time. #6688

Closed simssims closed 6 years ago

simssims commented 6 years ago

Hi, When I select a value from typeahead and click the next field, typeahead field is re-focusing again automatically (cursor jumping) due to timeout functionality. When I check the codes, timeout function can be removed from focus-out functions because "$rootScope:inprog" issue is not raised if timeout is removed. Appreciate for your help.

  //return focus to the input element if a match was selected via a mouse click event
  // use timeout to avoid $rootScope:inprog error
  if (scope.$eval(attrs.typeaheadFocusOnSelect) !== false) {
    $timeout(function() { element[0].focus(); }, 0, false);
  }

I just use "element[0].focus();" and it works with no issue.

icfantv commented 6 years ago

Closing this as this project is no longer being maintained, per the README and the ISSUE_TEMPLATE.