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