Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 5ae3d4c

Browse files
topherfangioThomasBurleson
authored andcommitted
fix(autocomplete): Allow clicks inside md-not-found.
Fix bug causing the autocomplete to blur, lose focus, and hide the not found message if the user attempted to click the not found message (or a link inside of it). Fixes #5424.
1 parent 61411a3 commit 5ae3d4c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/components/autocomplete/js/autocompleteController.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,10 @@ function MdAutocompleteCtrl ($scope, $element, $mdUtil, $mdConstant, $mdTheming,
370370
* @param forceBlur
371371
*/
372372
function doBlur(forceBlur) {
373-
if (forceBlur) noBlur = false;
373+
if (forceBlur) {
374+
noBlur = false;
375+
hasFocus = false;
376+
}
374377
elements.input.blur();
375378
}
376379

@@ -408,6 +411,9 @@ function MdAutocompleteCtrl ($scope, $element, $mdUtil, $mdConstant, $mdTheming,
408411
updateMessages();
409412
break;
410413
case $mdConstant.KEY_CODE.TAB:
414+
// If we hit tab, assume that we've left the list so it will close
415+
onListLeave();
416+
411417
if (ctrl.hidden || ctrl.loading || ctrl.index < 0 || ctrl.matches.length < 1) return;
412418
select(ctrl.index);
413419
break;

0 commit comments

Comments
 (0)