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

Commit bc3de20

Browse files
committed
Merge pull request #1131 from awerlang/872-debugInfo
fix(uiSelect): typing goes on last focused component
2 parents 55b8aaf + c0be90b commit bc3de20

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/uiSelectDirective.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ uis.directive('uiSelect',
149149
if (!contains && !$select.clickTriggeredSelect) {
150150
//Will lose focus only with certain targets
151151
var focusableControls = ['input','button','textarea'];
152-
var targetScope = angular.element(e.target).scope(); //To check if target is other ui-select
153-
var skipFocusser = targetScope && targetScope.$select && targetScope.$select !== $select; //To check if target is other ui-select
152+
var targetController = angular.element(e.target).controller('uiSelect'); //To check if target is other ui-select
153+
var skipFocusser = targetController && targetController !== $select; //To check if target is other ui-select
154154
if (!skipFocusser) skipFocusser = ~focusableControls.indexOf(e.target.tagName.toLowerCase()); //Check if target is input, button or textarea
155155
$select.close(skipFocusser);
156156
scope.$digest();

0 commit comments

Comments
 (0)