Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit a4732a9

Browse filesBrowse files
authored
fix(autocomplete): prevent flashing of invalid state (#12064)
- when user clicks on suggestion, input element lost focus and then programmatically get focused - again, add stop immediate propagation to prevent blur event handling by other handlers which - update ng-model validity state - add check that the event is an object Fixes #10975
1 parent 7d5e262 commit a4732a9
Copy full SHA for a4732a9

1 file changed

+3Lines changed: 3 additions & 0 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/components/autocomplete/js/autocompleteController.js‎

Copy file name to clipboardExpand all lines: src/components/autocomplete/js/autocompleteController.js
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,13 +598,16 @@ function MdAutocompleteCtrl ($scope, $element, $mdUtil, $mdConstant, $mdTheming,
598598

599599
/**
600600
* Handles input blur event, determines if the dropdown should hide.
601+
* @param {Event=} $event
601602
*/
602603
function blur($event) {
603604
hasFocus = false;
604605

605606
if (!noBlur) {
606607
ctrl.hidden = shouldHide();
607608
evalAttr('ngBlur', { $event: $event });
609+
} else if (angular.isObject($event)) {
610+
$event.stopImmediatePropagation();
608611
}
609612
}
610613

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.