From 449ed194d2da5d96e2431a8573ef755598f3bd8a Mon Sep 17 00:00:00 2001 From: Will Howell Date: Tue, 22 Aug 2017 17:02:18 -0400 Subject: [PATCH] fix(chips): mark onFocus as internal (#6519) --- src/lib/chips/chip-list.ts | 2 +- src/lib/chips/chip.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/chips/chip-list.ts b/src/lib/chips/chip-list.ts index 4d35584f9fb..dac3bb0c0bb 100644 --- a/src/lib/chips/chip-list.ts +++ b/src/lib/chips/chip-list.ts @@ -230,7 +230,7 @@ export class MdChipList implements AfterContentInit, OnDestroy { } // Watch for focus events outside of the keyboard navigation - chip.onFocus.subscribe(() => { + chip._onFocus.subscribe(() => { let chipIndex: number = this.chips.toArray().indexOf(chip); if (this._isValidIndex(chipIndex)) { diff --git a/src/lib/chips/chip.ts b/src/lib/chips/chip.ts index c150f572a24..6bc349b53d9 100644 --- a/src/lib/chips/chip.ts +++ b/src/lib/chips/chip.ts @@ -17,7 +17,7 @@ import { Renderer2, forwardRef, } from '@angular/core'; - +import {Subject} from 'rxjs/Subject'; import {FocusableOption} from '../core/a11y/focus-key-manager'; import {coerceBooleanProperty} from '@angular/cdk/coercion'; import {CanColor, mixinColor} from '../core/common-behaviors/color'; @@ -109,8 +109,8 @@ export class MdChip extends _MdChipMixinBase implements FocusableOption, OnDestr /** Whether the chip has focus. */ _hasFocus: boolean = false; - /** Emitted when the chip is focused. */ - onFocus = new EventEmitter(); + /** Emits when the chip is focused. */ + _onFocus = new Subject(); /** Emitted when the chip is selected. */ @Output() select = new EventEmitter(); @@ -145,7 +145,7 @@ export class MdChip extends _MdChipMixinBase implements FocusableOption, OnDestr /** Allows for programmatic focusing of the chip. */ focus(): void { this._elementRef.nativeElement.focus(); - this.onFocus.emit({chip: this}); + this._onFocus.next({chip: this}); } /**