Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(chip): mark onFocus as internal #6519

Merged
merged 1 commit into from
Aug 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/chips/chip-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
8 changes: 4 additions & 4 deletions src/lib/chips/chip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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<MdChipEvent>();
/** Emits when the chip is focused. */
_onFocus = new Subject<MdChipEvent>();

/** Emitted when the chip is selected. */
@Output() select = new EventEmitter<MdChipEvent>();
Expand Down Expand Up @@ -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});
}

/**
Expand Down