Skip to content

Commit 4039ba7

Browse files
committed
feat(material/chips): expose _chipGrid in MatChipInput and add a stream of chip removal events (#28012)
1 parent 17ea8e7 commit 4039ba7

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/material/chips/chip-input.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,19 @@ export class MatChipInput implements MatChipTextControl, AfterContentInit, OnCha
7575

7676
/** Whether the control is focused. */
7777
focused: boolean = false;
78-
_chipGrid: MatChipGrid;
7978

8079
/** Register input for chip list */
8180
@Input('matChipInputFor')
81+
get chipGrid(): MatChipGrid {
82+
return this._chipGrid;
83+
}
8284
set chipGrid(value: MatChipGrid) {
8385
if (value) {
8486
this._chipGrid = value;
8587
this._chipGrid.registerInput(this);
8688
}
8789
}
90+
_chipGrid: MatChipGrid;
8891

8992
/**
9093
* Whether or not the chipEnd event will be emitted when the input is blurred.

src/material/chips/chip-set.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,16 @@ export class MatChipSet
8080
return this._getChipStream(chip => chip._onFocus);
8181
}
8282

83-
/** Combined stream of all of the child chips' remove events. */
83+
/** Combined stream of all of the child chips' destroy events. */
8484
get chipDestroyedChanges(): Observable<MatChipEvent> {
8585
return this._getChipStream(chip => chip.destroyed);
8686
}
8787

88+
/** Combined stream of all of the child chips' remove events. */
89+
get chipRemovedChanges(): Observable<MatChipEvent> {
90+
return this._getChipStream(chip => chip.removed);
91+
}
92+
8893
/** Whether the chip set is disabled. */
8994
@Input()
9095
get disabled(): boolean {

0 commit comments

Comments
 (0)