Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1131 from awerlang/872-debugInfo
Browse files Browse the repository at this point in the history
fix(uiSelect): typing goes on last focused component
  • Loading branch information
dimirc committed Aug 9, 2015
2 parents 55b8aaf + c0be90b commit bc3de20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/uiSelectDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ uis.directive('uiSelect',
if (!contains && !$select.clickTriggeredSelect) {
//Will lose focus only with certain targets
var focusableControls = ['input','button','textarea'];
var targetScope = angular.element(e.target).scope(); //To check if target is other ui-select
var skipFocusser = targetScope && targetScope.$select && targetScope.$select !== $select; //To check if target is other ui-select
var targetController = angular.element(e.target).controller('uiSelect'); //To check if target is other ui-select
var skipFocusser = targetController && targetController !== $select; //To check if target is other ui-select
if (!skipFocusser) skipFocusser = ~focusableControls.indexOf(e.target.tagName.toLowerCase()); //Check if target is input, button or textarea
$select.close(skipFocusser);
scope.$digest();
Expand Down

0 comments on commit bc3de20

Please sign in to comment.