(event?: Event)
| 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; |
no test coverage detected