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

Commit c6489e8

Browse files
committed
fix for #944
Don't restore focus if it was moved out of select (irregardles of target element). Otherwise it looks too confusing when clicking on links or any other control that is not an input/button/textarea.
1 parent dbd32f2 commit c6489e8

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/uiSelectDirective.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,7 @@ uis.directive('uiSelect',
144144
}
145145

146146
if (!contains && !$select.clickTriggeredSelect) {
147-
//Will lose focus only with certain targets
148-
var focusableControls = ['input','button','textarea'];
149-
var targetScope = angular.element(e.target).scope(); //To check if target is other ui-select
150-
var skipFocusser = targetScope && targetScope.$select && targetScope.$select !== $select; //To check if target is other ui-select
151-
if (!skipFocusser) skipFocusser = ~focusableControls.indexOf(e.target.tagName.toLowerCase()); //Check if target is input, button or textarea
152-
$select.close(skipFocusser);
147+
$select.close(true);
153148
scope.$digest();
154149
}
155150
$select.clickTriggeredSelect = false;

0 commit comments

Comments
 (0)