Skip to content

Commit 449ed19

Browse files
willshowellkara
authored andcommitted
fix(chips): mark onFocus as internal (#6519)
1 parent df28c3d commit 449ed19

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/lib/chips/chip-list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export class MdChipList implements AfterContentInit, OnDestroy {
230230
}
231231

232232
// Watch for focus events outside of the keyboard navigation
233-
chip.onFocus.subscribe(() => {
233+
chip._onFocus.subscribe(() => {
234234
let chipIndex: number = this.chips.toArray().indexOf(chip);
235235

236236
if (this._isValidIndex(chipIndex)) {

src/lib/chips/chip.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
Renderer2,
1818
forwardRef,
1919
} from '@angular/core';
20-
20+
import {Subject} from 'rxjs/Subject';
2121
import {FocusableOption} from '../core/a11y/focus-key-manager';
2222
import {coerceBooleanProperty} from '@angular/cdk/coercion';
2323
import {CanColor, mixinColor} from '../core/common-behaviors/color';
@@ -109,8 +109,8 @@ export class MdChip extends _MdChipMixinBase implements FocusableOption, OnDestr
109109
/** Whether the chip has focus. */
110110
_hasFocus: boolean = false;
111111

112-
/** Emitted when the chip is focused. */
113-
onFocus = new EventEmitter<MdChipEvent>();
112+
/** Emits when the chip is focused. */
113+
_onFocus = new Subject<MdChipEvent>();
114114

115115
/** Emitted when the chip is selected. */
116116
@Output() select = new EventEmitter<MdChipEvent>();
@@ -145,7 +145,7 @@ export class MdChip extends _MdChipMixinBase implements FocusableOption, OnDestr
145145
/** Allows for programmatic focusing of the chip. */
146146
focus(): void {
147147
this._elementRef.nativeElement.focus();
148-
this.onFocus.emit({chip: this});
148+
this._onFocus.next({chip: this});
149149
}
150150

151151
/**

0 commit comments

Comments
 (0)