MCPcopy
hub / github.com/angular/components / _startEditing

Method _startEditing

src/material/chips/chip-row.ts:194–219  ·  view source on GitHub ↗
(event?: Event)

Source from the content-addressed store, hash-verified

192 }
193
194 private _startEditing(event?: Event) {
195 if (
196 !this.primaryAction ||
197 (this.removeIcon &&
198 !!event &&
199 this._getSourceAction(event.target as Node) === this.removeIcon)
200 ) {
201 return;
202 }
203
204 // The value depends on the DOM so we need to extract it before we flip the flag.
205 const value = this.value;
206
207 this._isEditing = this._editStartPending = true;
208
209 // Defer initializing the input until after it has been added to the DOM.
210 afterNextRender(
211 () => {
212 this._getEditInput().initialize(value);
213
214 // Necessary when using edit icon to prevent edit from aborting
215 setTimeout(() => this._ngZone.run(() => (this._editStartPending = false)));
216 },
217 {injector: this._injector},
218 );
219 }
220
221 private _onEditFinish() {
222 this._isEditing = this._editStartPending = false;

Callers 4

_handleKeydownMethod · 0.95
_handleClickMethod · 0.95
_handleDoubleclickMethod · 0.95
_editMethod · 0.95

Calls 3

_getEditInputMethod · 0.95
_getSourceActionMethod · 0.80
initializeMethod · 0.65

Tested by

no test coverage detected