Skip to content

Commit 0291bbf

Browse files
committed
Update to fix "typing goes on last focused component"
angular-ui#1131 angular-ui#872
1 parent 4e85291 commit 0291bbf

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/uiSelectDirective.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,9 @@ uis.directive('uiSelect',
115115
// Will lose focus only with certain targets
116116
var focusableControls = ['input', 'button', 'textarea'];
117117
// To check if target is other ui-select
118-
var targetScope = angular.element(e.target).scope();
118+
var targetController = angular.element(e.target).controller('uiSelect');
119119
// To check if target is other ui-select
120-
var skipFocusser = targetScope && targetScope.$select &&
121-
targetScope.$select !== $select;
120+
var skipFocusser = targetController && targetController !== $select;
122121
// Check if target is input, button or textarea
123122
if (!skipFocusser) {
124123
skipFocusser = ~focusableControls.indexOf(e.target.tagName.toLowerCase());

0 commit comments

Comments
 (0)