Skip to content

Commit 5345709

Browse files
Andrei CaleniucAndrei Caleniuc
authored andcommitted
fix: clear and focus suggest input on deselection
1 parent 2f91d25 commit 5345709

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

projects/angular/components/ui-suggest/src/ui-suggest.component.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,17 +1220,19 @@ export class UiSuggestComponent extends UiSuggestMatFormFieldDirective
12201220
if (!isItemSelected && value) {
12211221
if (!this.multiple) {
12221222
this._clearSelection();
1223-
} else if (!this.compact) {
1224-
if (this.inputControl.value) {
1225-
this.inputControl.setValue('');
1226-
}
1227-
this._focusChipInput();
12281223
}
12291224
this._pushEntry(value);
12301225

12311226
this._announceSelectStatus(value.text, true);
12321227
}
12331228

1229+
if (value && this.multiple && !this.compact) {
1230+
if (this.inputControl.value) {
1231+
this.inputControl.setValue('');
1232+
}
1233+
this._focusChipInput();
1234+
}
1235+
12341236
const alreadySelectedNormalValue = this.multiple &&
12351237
isItemSelected &&
12361238
!!value &&

0 commit comments

Comments
 (0)