Skip to content

Commit

Permalink
fix: address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
crisbeto committed Feb 28, 2017
1 parent b693766 commit ba31165
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/lib/autocomplete/autocomplete-trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export class MdAutocompleteTrigger implements ControlValueAccessor, OnDestroy {
this._onTouched();

// Only emit blur event if the new focus is *not* on an element inside the panel.
if (relatedTarget && !this._overlayRef.overlayElement.contains(relatedTarget)) {
if (!this._overlayRef.overlayElement.contains(relatedTarget)) {
this._blurStream.next(null);
}
}
Expand Down
8 changes: 2 additions & 6 deletions src/lib/autocomplete/autocomplete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {ENTER, DOWN_ARROW, SPACE, UP_ARROW} from '../core/keyboard/keycodes';
import {MdOption} from '../core/option/option';
import {ViewportRuler} from '../core/overlay/position/viewport-ruler';
import {FakeViewportRuler} from '../core/overlay/position/fake-viewport-ruler';
import {extendObject} from '../core/util/object-extend';
import {MdAutocomplete} from './autocomplete';
import {MdInputContainer} from '../input/input-container';
import {Observable} from 'rxjs/Observable';
Expand Down Expand Up @@ -1009,12 +1010,7 @@ class AutocompleteWithoutForms {
* @param extras Extra properties to be attached to the event object.
*/
function dispatchEvent(eventName: string, element: HTMLElement, extras?: any): void {
let event = document.createEvent('Event');

if (extras) {
Object.assign(event, extras);
}

let event = extendObject(document.createEvent('Event'), extras);
event.initEvent(eventName, true, true);
element.dispatchEvent(event);
}
Expand Down

0 comments on commit ba31165

Please sign in to comment.