File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed
Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,7 @@ <h4>Multi selection</h4>
160160
161161 < mat-checkbox [(ngModel)] ="disableInputs "> Disabled</ mat-checkbox >
162162 < mat-checkbox [(ngModel)] ="editable "> Editable</ mat-checkbox >
163+ < mat-checkbox [(ngModel)] ="showEditIcon "> Show Edit Icon</ mat-checkbox >
163164 < mat-checkbox [(ngModel)] ="disabledInteractive "> Disabled Interactive</ mat-checkbox >
164165
165166 < h4 > Input is last child of chip grid</ h4 >
@@ -172,9 +173,11 @@ <h4>Input is last child of chip grid</h4>
172173 [editable] ="editable "
173174 (removed) ="remove(person) "
174175 (edited) ="edit(person, $event) ">
175- < button matChipEdit aria-label ="Edit contributor ">
176- < mat-icon > edit</ mat-icon >
177- </ button >
176+ @if (showEditIcon) {
177+ < button matChipEdit aria-label ="Edit contributor ">
178+ < mat-icon > edit</ mat-icon >
179+ </ button >
180+ }
178181 {{person.name}}
179182 < button matChipRemove aria-label ="Remove contributor ">
180183 < mat-icon > close</ mat-icon >
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ export class ChipsDemo {
5252 listboxesWithAvatar = false ;
5353 disableInputs = false ;
5454 editable = false ;
55+ showEditIcon = false ;
5556 disabledInteractive = false ;
5657 message = '' ;
5758
Original file line number Diff line number Diff line change @@ -148,11 +148,9 @@ export class MatChipRow extends MatChip implements AfterViewInit {
148148 }
149149
150150 override _edit ( ) : void {
151- if ( ! this . disabled && this . editable ) {
152- // markForCheck necessary for edit input to be rendered
153- this . _changeDetectorRef . markForCheck ( ) ;
154- this . _startEditing ( ) ;
155- }
151+ // markForCheck necessary for edit input to be rendered
152+ this . _changeDetectorRef . markForCheck ( ) ;
153+ this . _startEditing ( ) ;
156154 }
157155
158156 private _startEditing ( event ?: Event ) {
You can’t perform that action at this time.
0 commit comments