File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -178,8 +178,12 @@ export class MatChipRow extends MatChip implements AfterViewInit {
178
178
// The value depends on the DOM so we need to extract it before we flip the flag.
179
179
const value = this . value ;
180
180
181
- this . _isEditing = true ;
182
- this . _editStartPending = true ;
181
+ this . _isEditing = this . _editStartPending = true ;
182
+
183
+ // Starting the editing sequence below depends on the edit input
184
+ // query resolving on time. Trigger a synchronous change detection to
185
+ // ensure that it happens by the time we hit the timeout below.
186
+ this . _changeDetectorRef . detectChanges ( ) ;
183
187
184
188
// Defer initializing the input so it has time to be added to the DOM.
185
189
setTimeout ( ( ) => {
@@ -189,8 +193,7 @@ export class MatChipRow extends MatChip implements AfterViewInit {
189
193
}
190
194
191
195
private _onEditFinish ( ) {
192
- this . _isEditing = false ;
193
- this . _editStartPending = false ;
196
+ this . _isEditing = this . _editStartPending = false ;
194
197
this . edited . emit ( { chip : this , value : this . _getEditInput ( ) . getValue ( ) } ) ;
195
198
196
199
// If the edit input is still focused or focus was returned to the body after it was destroyed,
You can’t perform that action at this time.
0 commit comments