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

Commit 8f14afd

Browse files
Splaktarandrewseguin
authored andcommitted
fix(autocomplete): options panel flickers on hover after clicking input (#11757)
stop propagation of input's click events up to the document - similar to what we already do with the clear button (X) Closure/JSDoc typing improvements Relates to #11625
1 parent 9cf331f commit 8f14afd

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/components/autocomplete/js/autocompleteController.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function MdAutocompleteCtrl ($scope, $element, $mdUtil, $mdConstant, $mdTheming,
3232
* close the options panel when a click outside said panel occurs. We use `documentElement`
3333
* instead of body because, when scrolling is disabled, some browsers consider the body element
3434
* to be completely off the screen and propagate events directly to the html element.
35-
* @type {!angular.JQLite}
35+
* @type {!Object} angular.JQLite
3636
*/
3737
ctrl.documentElement = angular.element(document.documentElement);
3838

@@ -351,8 +351,8 @@ function MdAutocompleteCtrl ($scope, $element, $mdUtil, $mdConstant, $mdTheming,
351351

352352
/**
353353
* Handles changes to the `hidden` property.
354-
* @param hidden
355-
* @param oldHidden
354+
* @param {boolean} hidden
355+
* @param {boolean} oldHidden
356356
*/
357357
function handleHiddenChange (hidden, oldHidden) {
358358
if (!hidden && oldHidden) {

src/components/autocomplete/js/autocompleteDirective.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,7 @@ function MdAutocomplete ($$mdSvgRegistry) {
493493
ng-keydown="$mdAutocompleteCtrl.keydown($event)"\
494494
ng-blur="$mdAutocompleteCtrl.blur($event)"\
495495
ng-focus="$mdAutocompleteCtrl.focus($event)"\
496+
ng-click="$event.stopPropagation()"\
496497
aria-label="{{floatingLabel}}"\
497498
aria-autocomplete="list"\
498499
role="combobox"\
@@ -520,6 +521,7 @@ function MdAutocomplete ($$mdSvgRegistry) {
520521
ng-keydown="$mdAutocompleteCtrl.keydown($event)"\
521522
ng-blur="$mdAutocompleteCtrl.blur($event)"\
522523
ng-focus="$mdAutocompleteCtrl.focus($event)"\
524+
ng-click="$event.stopPropagation()"\
523525
placeholder="{{placeholder}}"\
524526
aria-label="{{placeholder}}"\
525527
aria-autocomplete="list"\

src/core/util/util.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ function UtilFactory($document, $timeout, $compile, $rootScope, $$mdAnimate, $in
215215

216216
/**
217217
* Disables scroll around the passed parent element.
218-
* @param {!Element|!angular.JQLite} element Origin Element (not used)
219-
* @param {!Element|!angular.JQLite} parent Element to disable scrolling within.
218+
* @param {Element|angular.JQLite=} element Origin Element (not used)
219+
* @param {Element|angular.JQLite=} parent Element to disable scrolling within.
220220
* Defaults to body if none supplied.
221221
* @param {Object=} options Object of options to modify functionality
222222
* - disableScrollMask Boolean of whether or not to create a scroll mask element or

0 commit comments

Comments
 (0)