mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
[ADF-3229] people widget list reseted if empty input (#3507)
* list reseted when input is empty * test added
This commit is contained in:
parent
c1b12204f3
commit
7dd462fb1a
@ -169,6 +169,18 @@ describe('PeopleWidgetComponent', () => {
|
||||
});
|
||||
}));
|
||||
|
||||
it('should hide result list if input is empty', () => {
|
||||
let peopleHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input');
|
||||
peopleHTMLElement.focus();
|
||||
peopleHTMLElement.value = '';
|
||||
peopleHTMLElement.dispatchEvent(new Event('keyup'));
|
||||
peopleHTMLElement.dispatchEvent(new Event('input'));
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
expect(fixture.debugElement.query(By.css('#adf-people-widget-user-0'))).toBeNull();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -80,6 +80,7 @@ export class PeopleWidgetComponent extends WidgetComponent implements OnInit {
|
||||
this.checkUserAndValidateForm(list, value);
|
||||
} else {
|
||||
this.field.value = null;
|
||||
list = [];
|
||||
}
|
||||
|
||||
return list;
|
||||
|
Loading…
x
Reference in New Issue
Block a user